Package java.util

Examples of java.util.Scanner.useDelimiter()


                                                final String token) {
        return new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                Object value = expression.evaluate(exchange, Object.class);
                Scanner scanner = ObjectHelper.getScanner(exchange, value);
                scanner.useDelimiter(token);
                return scanner;
            }

            @Override
            public String toString() {
View Full Code Here


        final Pattern pattern = Pattern.compile(regexTokenizer);
        return new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                Object value = expression.evaluate(exchange, Object.class);
                Scanner scanner = ObjectHelper.getScanner(exchange, value);
                scanner.useDelimiter(regexTokenizer);
                return scanner;
            }

            @Override
            public String toString() {
View Full Code Here

            // this code is optimized to only use a Scanner if needed, eg there is a delimiter

            if (delimiter != null && s.contains(delimiter)) {
                // use a scanner if it contains the delimiter
                Scanner scanner = new Scanner((String)value);
                scanner.useDelimiter(delimiter);
                return CastUtils.cast(scanner);
            } else {
                // use a plain iterator that returns the value as is as there are only a single value
                return CastUtils.cast(new Iterator<String>() {
                    int idx = -1;
View Full Code Here

                                                final String token) {
        return new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                Object value = expression.evaluate(exchange, Object.class);
                Scanner scanner = ObjectHelper.getScanner(exchange, value);
                scanner.useDelimiter(token);
                return scanner;
            }

            @Override
            public String toString() {
View Full Code Here

        final Pattern pattern = Pattern.compile(regexTokenizer);
        return new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                Object value = expression.evaluate(exchange, Object.class);
                Scanner scanner = ObjectHelper.getScanner(exchange, value);
                scanner.useDelimiter(regexTokenizer);
                return scanner;
            }

            @Override
            public String toString() {
View Full Code Here

//              v.setCoordX( Integer.parseInt( domVillageCoordX[i].toString().replace( "(", "")));
//              v.setCoordY( Integer.parseInt( domVillageCoordY[i].toString().replace( ")", "")));
//              System.out.println( domVillageCoords[i].toString());

                Scanner s = new Scanner( domVillageCoords[i].toString());
                s.useDelimiter( "[ ()|\n\r\f\t]+");
//              s.findInLine( "\\s*\\((\\d+)\\s*|\\s*(\\d+)\\)");
//              s.findInLine( "\\s*\\((\\d+)\\s*|\\s*(\\d+)\\)");

//                String[] data = Util.patternExtract( "\\(([+\\-\\d]+)[^|]*.*|.*([+\\-\\d]+)\\)", domVillageCoords[i].toString(), 2);
//System.out.println( data[0]);
View Full Code Here

//              v.setCoordX( Integer.parseInt( domVillageCoordX[i].toString().replace( "(", "")));
//              v.setCoordY( Integer.parseInt( domVillageCoordY[i].toString().replace( ")", "")));
//              System.out.println( domVillageCoords[i].toString());

                Scanner s = new Scanner( domVillageCoords[i].toString());
                s.useDelimiter( "[ ()|\n\r\f\t]+");
//              s.findInLine( "\\s*\\((\\d+)\\s*|\\s*(\\d+)\\)");
//              s.findInLine( "\\s*\\((\\d+)\\s*|\\s*(\\d+)\\)");

//                String[] data = Util.patternExtract( "\\(([+\\-\\d]+)[^|]*.*|.*([+\\-\\d]+)\\)", domVillageCoords[i].toString(), 2);
//System.out.println( data[0]);
View Full Code Here

            // this code is optimized to only use a Scanner if needed, eg there is a delimiter

            if (s.contains(delimiter)) {
                // use a scanner if it contains the delimiter
                Scanner scanner = new Scanner((String)value);
                scanner.useDelimiter(delimiter);
                return CastUtils.cast(scanner);
            } else {
                // use a plain iterator that returns the value as is as there are only a single value
                return CastUtils.cast(new Iterator<String>() {
                    int idx = -1;
View Full Code Here

                                                final String token) {
        return new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                Object value = expression.evaluate(exchange, Object.class);
                Scanner scanner = ObjectHelper.getScanner(exchange, value);
                scanner.useDelimiter(token);
                return scanner;
            }

            @Override
            public String toString() {
View Full Code Here

        final Pattern pattern = Pattern.compile(regexTokenizer);
        return new ExpressionAdapter() {
            public Object evaluate(Exchange exchange) {
                Object value = expression.evaluate(exchange, Object.class);
                Scanner scanner = ObjectHelper.getScanner(exchange, value);
                scanner.useDelimiter(regexTokenizer);
                return scanner;
            }

            @Override
            public String toString() {
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.