/** * Returns the next value in the iterator as a boolean. * @return the next value in the iterator as a boolean. * @throws NoSuchElementException if the iteration has no more elements. */ public boolean nextBooleanValue() { return ConfigurationSection.getBooleanValue(nextValue()); }
/** * Returns the next value in the iterator as a integer. * @return the next value in the iterator as a integer. * @throws NoSuchElementException if the iteration has no more elements. * @throws NumberFormatException if the value cannot be cast to an integer. */ public int nextIntegerValue() { return ConfigurationSection.getIntegerValue(nextValue()); }
/** * Returns the next value in the iterator as a long. * @return the next value in the iterator as a long. * @throws NoSuchElementException if the iteration has no more elements. * @throws NumberFormatException if the value cannot be cast to a long. */ public long nextLongValue() { return ConfigurationSection.getLongValue(nextValue()); }
/** * Returns the next value in the iterator as a float. * @return the next value in the iterator as a float. * @throws NoSuchElementException if the iteration has no more elements. * @throws NumberFormatException if the value cannot be cast to a float. */ public float nextFloatValue() { return ConfigurationSection.getFloatValue(nextValue()); }
/** * Returns the next value in the iterator as a double. * @return the next value in the iterator as a double. * @throws NoSuchElementException if the iteration has no more elements. * @throws NumberFormatException if the value cannot be cast to a double. */ public double nextDoubleValue() { return ConfigurationSection.getDoubleValue(nextValue()); }
/** * Returns the next value in the iterator as a {@link ValueList}. * @param separator stirng used to tokenise the next value. * @return the next value in the iterator as a {@link ValueList}. * @throws NoSuchElementException if the iteration has no more elements. */ public ValueList nextListValue(String separator) { return ConfigurationSection.getListValue(nextValue(), separator); } }
/** * Tests the {@link ValueIterator#nextValue()} method. * @param values test data. */ @Override protected void testStringValues(ValueList values) { ValueIterator iterator; iterator = values.valueIterator(); for(int i = 0; i < 7; i++) { assert iterator.hasNext(); assert Integer.toString(i + 1).equals(iterator.nextValue()); } assert !iterator.hasNext(); }