public static ArrayIndexOperation parse(String operation) { //check valid chars for (int i = 0; i < operation.length(); i++) { char c = operation.charAt(i); if (!isDigit(c) && c != ',' && c != ' ' && c != '-') { throw new InvalidPathException("Failed to parse ArrayIndexOperation: " + operation); } } String[] tokens = COMMA.split(operation, -1); List<Integer> tempIndexes = new ArrayList<Integer>(tokens.length); for (String token : tokens) { tempIndexes.add(parseInteger(token)); } return new ArrayIndexOperation(tempIndexes); }
public static ArrayIndexOperation parse(String operation) { //check valid chars for (int i = 0; i < operation.length(); i++) { char c = operation.charAt(i); if (!isDigit(c) && c != ',' && c != ' ' && c != '-') { throw new InvalidPathException("Failed to parse ArrayIndexOperation: " + operation); } } String[] tokens = COMMA.split(operation, -1); List<Integer> tempIndexes = new ArrayList<Integer>(tokens.length); for (String token : tokens) { tempIndexes.add(parseInteger(token)); } return new ArrayIndexOperation(tempIndexes); }
public static ArrayIndexOperation parse(String operation) { //check valid chars for (int i = 0; i < operation.length(); i++) { char c = operation.charAt(i); if (!isDigit(c) && c != ',' && c != ' ' && c != '-') { throw new InvalidPathException("Failed to parse ArrayIndexOperation: " + operation); } } String[] tokens = COMMA.split(operation, -1); List<Integer> tempIndexes = new ArrayList<Integer>(tokens.length); for (String token : tokens) { tempIndexes.add(parseInteger(token)); } return new ArrayIndexOperation(tempIndexes); }