protected Double[] readDoubleArray(int count) throws FormatException, IOException { Double[] result = new Double[count]; for (int i = 0; i < count; i++) { result[i] = new Double(readNumber().doubleValue()); skipWhiteSpace(); } return result; }
protected Integer[] readIntArray(int count) throws FormatException, IOException { Integer[] result = new Integer[count]; for (int i = 0; i < count; i++) { result[i] = (Integer) readNumber(); skipWhiteSpace(); } return result; }
protected Integer[] readIntArray(int count) throws FormatException, IOException { Integer[] result = new Integer[count]; for (int i = 0; i < count; i++) { result[i] = (Integer) readNumber(); skipWhiteSpace(); } return result; }
protected Double[] readDoubleArray(int count) throws FormatException, IOException { Double[] result = new Double[count]; for (int i = 0; i < count; i++) { result[i] = new Double(readNumber().doubleValue()); skipWhiteSpace(); } return result; }
protected Integer[] readIntArray() throws FormatException, IOException { // read integers until end of line ArrayList<Integer> result = new ArrayList<Integer>(); int currentRow = row; // Keep reading until we hit newline or a non-numeric while (currentRow == row && ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+')) { result.add((Integer) readNumber()); skipWhiteSpace(); } Integer[] intResult = new Integer[result.size()]; return result.toArray(intResult); }
protected Integer[] readIntArray() throws FormatException, IOException { // read integers until end of line ArrayList<Integer> result = new ArrayList<Integer>(); int currentRow = row; // Keep reading until we hit newline or a non-numeric while (currentRow == row && ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+')) { result.add((Integer) readNumber()); skipWhiteSpace(); } Integer[] intResult = new Integer[result.size()]; return result.toArray(intResult); }
protected Number[] readNumberArray() throws FormatException, IOException { // read integers until end of line ArrayList<Number> result = new ArrayList<Number>(); boolean intsOnly = true; int currentRow = row; // Keep reading until we hit newline or a non-numeric while (currentRow == row && ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+')) { Number n = readNumber(); if (n instanceof Double) { intsOnly = false; } result.add(n); skipWhiteSpace(); } if (intsOnly) { Integer[] intResult = new Integer[result.size()]; return result.toArray(intResult); } else { // nb this is necessary because we may have a mix // of Integers and Doubles Double[] doubleResult = new Double[result.size()]; for (int i = 0; i < doubleResult.length; i++) { doubleResult[i] = new Double(result.get(i).doubleValue()); } return doubleResult; } }
protected Number[] readNumberArray() throws FormatException, IOException { // read integers until end of line ArrayList<Number> result = new ArrayList<Number>(); boolean intsOnly = true; int currentRow = row; // Keep reading until we hit newline or a non-numeric while (currentRow == row && ((c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+')) { Number n = readNumber(); if (n instanceof Double) { intsOnly = false; } result.add(n); skipWhiteSpace(); } if (intsOnly) { Integer[] intResult = new Integer[result.size()]; return result.toArray(intResult); } else { // nb this is necessary because we may have a mix // of Integers and Doubles Double[] doubleResult = new Double[result.size()]; for (int i = 0; i < doubleResult.length; i++) { doubleResult[i] = new Double(result.get(i).doubleValue()); } return doubleResult; } }
firstDataStream = readNumber().intValue(); skipComment(); return; int index = readNumber().intValue();
firstDataStream = readNumber().intValue(); skipComment(); return; int index = readNumber().intValue();