Examples of ExprString


Examples of org.boris.expr.ExprString

        }
        sb.append(rep);
        if (start + len <= stlen) {
            sb.append(str.substring(start + len - 1));
        }
        return new ExprString(sb.toString());
    }
View Full Code Here

Examples of org.boris.expr.ExprString

        assertArgCount(args, 1);
        int c = asInteger(args[0], true);
        if (c < 1 || c > 255)
            return ExprError.VALUE;
        else
            return new ExprString("" + (char) c);
    }
View Full Code Here

Examples of org.boris.expr.ExprString

        if (!(a instanceof ExprString))
            return ExprError.VALUE;

        String s = ((ExprString) a).str;
        if ("directory".equalsIgnoreCase(s)) {
            return new ExprString(System.getProperty("user.dir"));
        } else if ("memavail".equalsIgnoreCase(s)) {
            return new ExprDouble(Runtime.getRuntime().freeMemory());
        } else if ("memused".equalsIgnoreCase(s)) {
            return new ExprDouble(Runtime.getRuntime().totalMemory() -
                    Runtime.getRuntime().freeMemory());
View Full Code Here

Examples of org.boris.expr.ExprString

            } else {
                proper = true;
                sb.append(c);
            }
        }
        return new ExprString(sb.toString());
    }
View Full Code Here

Examples of org.boris.expr.ExprString

        assertArgCount(args, 1);
        Expr a = evalArg(args[0]);
        if (a instanceof ExprArray)
            return ExprError.VALUE;
        if (a instanceof ExprString)
            return new ExprString(((ExprString) a).str.toUpperCase());
        return new ExprString(a.toString().toUpperCase());
    }
View Full Code Here

Examples of org.boris.expr.ExprString

        assertArgCount(args, 1);
        Expr a = evalArg(args[0]);
        if (a instanceof ExprArray)
            return ExprError.VALUE;
        if (a instanceof ExprString)
            return new ExprString(((ExprString) a).str.toLowerCase());
        return new ExprString(a.toString().toLowerCase());
    }
View Full Code Here

Examples of org.boris.expr.ExprString

            String s = str.toString();
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < rep; i++) {
                sb.append(s);
            }
            return new ExprString(sb.toString());
        }
    }
View Full Code Here

Examples of org.boris.expr.ExprString

            StringBuilder sb = new StringBuilder();
            if (idx > 0)
                sb.append(str.substring(0, idx));
            sb.append(nu);
            sb.append(str.substring(idx + old.length()));
            return new ExprString(sb.toString());
        } else {
            return new ExprString(str);
        }
    }
View Full Code Here

Examples of org.boris.expr.ExprString

            r = asInteger(args[1], true);
        }
        int len = str.length() - r;
        if (len < 0)
            len = 0;
        return new ExprString(str.substring(len));
    }
View Full Code Here

Examples of org.boris.expr.ExprString

        String str = null;
        if (a instanceof ExprString)
            str = ((ExprString) a).str;
        else
            str = a.toString();
        return new ExprString(str.trim());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.