/** * 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 a {@link ValueIterator} on the list. * @return a {@link ValueIterator} on the list. */ public ValueIterator valueIterator() { return new ValueIterator(iterator()); }
/** * 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(); }
/** * Tests the {@link ValueIterator#nextIntegerValue()} method. * @param values test data. */ @Override protected void testIntegerValues(ValueList values) { ValueIterator iterator; iterator = values.valueIterator(); for(int i = 0; i < 7; i++) { assert iterator.hasNext(); assert i + 1 == iterator.nextIntegerValue(); } assert !iterator.hasNext(); }
/** * Tests the {@link ValueIterator#nextDoubleValue()} method. * @param values test data. */ @Override protected void testDoubleValues(ValueList values) { ValueIterator iterator; iterator = values.valueIterator(); for(int i = 0; i < 7; i++) { assert iterator.hasNext(); assert i + 1.5 == iterator.nextDoubleValue(); } }
/** * Tests the {@link ValueIterator#nextBooleanValue()} method. * @param values test data. */ @Override protected void testBooleanValues(ValueList values) { ValueIterator iterator; iterator = values.valueIterator(); for(int i = 0; i < 7; i++) { assert iterator.hasNext(); assert (i % 2 == 0) == iterator.nextBooleanValue(); } }
/** * Tests the {@link ValueIterator#nextFloatValue()} method. * @param values test data. */ @Override protected void testFloatValues(ValueList values) { ValueIterator iterator; iterator = values.valueIterator(); for(int i = 0; i < 7; i++) { assert iterator.hasNext(); assert i + 1.5 == iterator.nextFloatValue(); } }
/** * Tests the {@link ValueIterator#nextLongValue()} method. * @param values test data. */ @Override protected void testLongValues(ValueList values) { ValueIterator iterator; iterator = values.valueIterator(); for(int i = 0; i < 7; i++) { assert iterator.hasNext(); assert i + 1 == iterator.nextLongValue(); } }
assert iterator.hasNext(); testStringValues(iterator.nextListValue(separator)); assert iterator.hasNext(); testIntegerValues(iterator.nextListValue(separator)); assert iterator.hasNext(); testLongValues(iterator.nextListValue(separator)); assert iterator.hasNext(); testFloatValues(iterator.nextListValue(separator)); assert iterator.hasNext(); testDoubleValues(iterator.nextListValue(separator)); assert iterator.hasNext(); testBooleanValues(iterator.nextListValue(separator)); assert !iterator.hasNext();
/** * 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); } }
/** * 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()); }