/** Returns the sequence of local name for this {@linkplain GenericName generic name}. */ public List<LocalName> getParsedNames() { if (parsedNames == null) { final List<? extends LocalName> parents = scope.getParsedNames(); final int size = parents.size(); LocalName[] names = new LocalName[size + 1]; names = parents.toArray(names); names[size] = name; parsedNames = Arrays.asList(names); } return parsedNames; }
/** * Returns the sequence of {@linkplain LocalName local names} making this generic name. Each * element in this list is like a directory name in a file path name. The length of this * sequence is the generic name depth. */ public List<LocalName> getParsedNames() { // TODO: temporary hack to be removed after GeoAPI update. return (List) getName().getParsedNames(); }
final Iterator<? extends LocalName> thatNames = that.getParsedNames().iterator(); while (thisNames.hasNext()) { if (!thatNames.hasNext()) {
/** * Returns the sequence of local name for this {@linkplain GenericName generic name}. */ public List<LocalName> getParsedNames() { if (parsedNames == null) { final List<? extends LocalName> parents = scope.getParsedNames(); final int size = parents.size(); LocalName[] names = new LocalName[size + 1]; names = parents.toArray(names); names[size] = name; parsedNames = Arrays.asList(names); } return parsedNames; }
/** * Returns the sequence of local name for this {@linkplain GenericName generic name}. */ public List getParsedNames() { if (parsedNames == null) { final List parents = scope.getParsedNames(); final int size = parents.size(); GenericName[] names = new GenericName[size + 1]; names = (GenericName[]) parents.toArray(names); names[size] = name; parsedNames = Arrays.asList(names); } return parsedNames; }
/** * Returns the sequence of {@linkplain LocalName local names} making this generic name. * The length of this sequence is the {@linkplain #depth() depth}. * It does not include the {@linkplain #scope() scope}. * * @return the local names making this generic name, without the {@linkplain #scope() scope}. * Shall never be {@code null} neither empty. */ @Override public List<? extends LocalName> getParsedNames() { return getName().getParsedNames(); }
/** * Returns the sequence of {@linkplain LocalName local names} making this generic name. * The length of this sequence is the {@linkplain #depth() depth}. * It does not include the {@linkplain #scope() scope}. * * @return the local names making this generic name, without the {@linkplain #scope() scope}. * Shall never be {@code null} neither empty. */ @Override public List<? extends LocalName> getParsedNames() { return getName().getParsedNames(); }
/** * Splits the given name in (catalog, schema, table) tuple. * Those components are returned in an array of length 3, in reverse order. */ static String[] splitName(final GenericName name) { String[] parts = name.getParsedNames().stream().map(LocalName::toString).toArray(String[]::new); ArraysExt.reverse(parts); // Reorganize in (table, schema, catalog) order. return ArraysExt.resize(parts, 3); // Pad with null values if necessary. }
final org.opengis.util.GenericName that = (org.opengis.util.GenericName) object; final Iterator thisNames = this.getParsedNames().iterator(); final Iterator thatNames = that.getParsedNames().iterator(); while (thisNames.hasNext()) { if (!thatNames.hasNext()) {
final Iterator<? extends LocalName> thatNames = that.getParsedNames().iterator(); while (thisNames.hasNext()) { if (!thatNames.hasNext()) {
public int compareTo(final GenericName name) { final Iterator<? extends LocalName> thisNames = this.getParsedNames().iterator(); final Iterator<? extends LocalName> thatNames = name.getParsedNames().iterator(); while (thisNames.hasNext()) { if (!thatNames.hasNext()) {
public int compareTo(final GenericName name) { final Iterator<? extends LocalName> thisNames = this.getParsedNames().iterator(); final Iterator<? extends LocalName> thatNames = name.getParsedNames().iterator(); while (thisNames.hasNext()) { if (!thatNames.hasNext()) {
return null; final List<? extends LocalName> parsedNames = name.getParsedNames(); final ListIterator<? extends LocalName> it = parsedNames.listIterator(parsedNames.size()); NameSpace scope;
/** * Recreates a new name for the given name, using the given factory. * This is used in order to get a Geotk implementation from an * arbitrary implementation. */ static GenericName wrap(final GenericName value, final NameFactory factory) { final List<? extends LocalName> parsedNames = value.getParsedNames(); final CharSequence[] names = new CharSequence[parsedNames.size()]; int i=0; for (final LocalName name : parsedNames) { // Asks for the unlocalized name, since we are going to marshal that. names[i++] = name.toInternationalString().toString(null); } if (i != names.length) { throw new ConcurrentModificationException(); } return factory.createGenericName(value.scope(), names); }
return null; final List<? extends LocalName> parsedNames = name.getParsedNames(); final ListIterator<? extends LocalName> it = parsedNames.listIterator(parsedNames.size()); NameSpace scope;
final List<? extends LocalName> parsedNames = object.getParsedNames(); final CharSequence[] names = new CharSequence[parsedNames.size()]; int i=0;
final List<? extends LocalName> parsedPath = path.getParsedNames(); final int index = parsedPath.size(); final LocalName[] locals = parsedPath.toArray(new LocalName[index + 1]);
final List<? extends LocalName> parsedPath = path.getParsedNames(); final int index = parsedPath.size(); final LocalName[] locals = parsedPath.toArray(new LocalName[index + 1]);
validate(name, name.getParsedNames());
/** * Ensures that ISO 19103 or GeoAPI restrictions apply. * * @param object The object to validate, or {@code null}. */ public void validate(final NameSpace object) { if (object == null) { return; } final GenericName name = object.name(); mandatory("NameSpace: must have a name.", name); if (name != null) { final NameSpace scope = name.scope(); mandatory("NameSpace: must have a scope.", scope); if (scope != null) { assertTrue("NameSpace: scope must be global.", scope.isGlobal()); } // Following test is a consequence of the previous one, so we check the scope first in // order to report the error as a bad scope before to reference this GeoAPI extension. assertSame("NameSpace: the name must be fully qualified.", name, name.toFullyQualifiedName()); } if (object.isGlobal()) { assertInstanceOf("NameSpace: global namespace must have a local name.", LocalName.class, name); } validate(name, name.getParsedNames()); }