/** * Returns the table for the given name. * The given name may be one of the tables specified at construction time, or one of its dependencies. * * @param store the data store for which we are fetching a table. Used only in case of error. * @param name name of the table to fetch. * @return the table (never null). * @throws IllegalNameException if no table of the given name is found or if the name is ambiguous. */ public final FeatureSet findTable(final SQLStore store, final String name) throws IllegalNameException { return tablesByNames.get(store, name); }
/** * Returns the feature type for the given name. The {@code name} argument should be the result of calling * {@link org.opengis.util.GenericName#toString()} on the name of one of the feature types in this data store. * * @param name the name or alias of the feature type to get. * @return the feature type of the given name or alias (never {@code null}). * @throws IllegalNameException if the given name was not found or is ambiguous. * * @deprecated We are not sure yet if we will keep this method. Decision is pending acquisition of * more experience with the API proposed by {@link org.apache.sis.storage.FeatureSet}. */ @Deprecated public DefaultFeatureType getFeatureType(final String name) throws IllegalNameException { return types.names.get(this, name); }
map.add(store, B, 5); map.add(store, otherA, 7); assertEquals("B", Integer.valueOf(5), map.get(store, "B")); assertEquals("A", Integer.valueOf(3), map.get(store, "A")); assertEquals("myNS:A", Integer.valueOf(2), map.get(store, "myNS:A")); assertEquals("other:A", Integer.valueOf(7), map.get(store, "other:A")); map.add(store, A, 2); map.add(store, local, 3); assertEquals("B", Integer.valueOf(5), map.get(store, "B")); assertEquals("A", Integer.valueOf(3), map.get(store, "A")); assertEquals("myNS:A", Integer.valueOf(2), map.get(store, "myNS:A")); assertEquals("other:A", Integer.valueOf(7), map.get(store, "other:A"));
assertEquals("otherA", Integer.valueOf(3), map.get(store, "other:A")); assertEquals("myNS:A", Integer.valueOf(1), map.get(store, "myNS:A")); assertTrue("remove", map.remove(store, A)); try { map.get(store, "myNS:A"); fail("Should not find a non-existent entry."); } catch (IllegalNameException e) { assertEquals("A", Integer.valueOf(3), map.get(store, "A")); assertEquals("B", Integer.valueOf(2), map.get(store, "B")); assertEquals("otherA", Integer.valueOf(3), map.get(store, "other:A"));
map.add(store, B, 2); map.add(store, otherA, 3); assertEquals("A", Integer.valueOf(1), map.get(store, "myNS:A")); assertEquals("B", Integer.valueOf(2), map.get(store, "B")); assertEquals("otherA", Integer.valueOf(3), map.get(store, "other:A")); map.get(store, "A"); fail("Should not find an ambiguous entry."); } catch (IllegalNameException e) {
map.add(store, A, 1); map.add(store, B, 2); assertEquals("A", Integer.valueOf(1), map.get(store, "myNS:A")); assertEquals("A", Integer.valueOf(1), map.get(store, "A")); assertEquals("B", Integer.valueOf(2), map.get(store, "B")); map.get(store, "C"); fail("Should not find a non-existent entry."); } catch (IllegalNameException e) { Integer.valueOf(2), map.get(store, "B"));