/** * Returns the information to which the specified key is mapped, * or {@code null} if this map contains no mapping for the key. */ @Override public ExtendedElementInformation get(final Object key) { if (key instanceof String) { return accessor.information(accessor.indexOf((String) key, false)); } return null; }
@Override public Map.Entry<String,ExtendedElementInformation> next() { final ExtendedElementInformation value = accessor.information(index); if (value == null) { // PropertyAccessor.information(int) never return null if the index is valid. throw new NoSuchElementException(); } return new SimpleImmutableEntry<>(accessor.name(index++, keyPolicy), value); } };
/** * Returns the information to which the specified key is mapped, * or {@code null} if this map contains no mapping for the key. */ @Override public ExtendedElementInformation get(final Object key) { if (key instanceof String) { return accessor.information(accessor.indexOf((String) key, false)); } return null; }
@Override public Map.Entry<String,ExtendedElementInformation> next() { final ExtendedElementInformation value = accessor.information(index); if (value == null) { // PropertyAccessor.information(int) never return null if the index is valid. throw new NoSuchElementException(); } return new SimpleImmutableEntry<>(accessor.name(index++, keyPolicy), value); } };
/** * Tests the {@link PropertyAccessor#information(int)} method. * This method delegates to some {@link PropertyInformationTest} methods. */ @Test @DependsOnMethod("testConstructor") public void testInformation() { final PropertyAccessor accessor = createPropertyAccessor(); PropertyInformationTest.validateTitle (accessor.information(accessor.indexOf("title", true))); PropertyInformationTest.validatePresentationForm(accessor.information(accessor.indexOf("presentationForm", true))); }
/** * Tests {@link SpecialCases#information(int)}. */ @Test public void testPropertyInformation() { final ExtendedElementInformation info = accessor.information(accessor.indexOf("westBoundLongitude", true)); final InternationalString domain = info.getDomainValue(); assertInstanceOf("Expected numerical information about range.", NumberRange.class, domain); final NumberRange<?> range = (NumberRange) domain; assertEquals(-180, range.getMinDouble(), STRICT); assertEquals(+180, range.getMaxDouble(), STRICT); } }