/** * Creates a new identifier from the specified name. This constructor infers the identifier attributes * (code, codespace and authority) from the given name. Calls to name-related methods like {@link #tip()}, * {@link #head()} and {@link #scope()} will delegate to the given name. * * @param name the name to wrap. */ public NamedIdentifier(final GenericName name) { super(name instanceof ReferenceIdentifier ? (ReferenceIdentifier) name : new NameToIdentifier(name)); this.name = name; isNameSupplied = true; }
/** * Creates a new identifier from the specified name. This constructor infers the identifier attributes * (code, codespace and authority) from the given name. Calls to name-related methods like {@link #tip()}, * {@link #head()} and {@link #scope()} will delegate to the given name. * * @param name the name to wrap. * * @see #castOrCopy(GenericName) */ public NamedIdentifier(final GenericName name) { super(name instanceof ReferenceIdentifier ? (ReferenceIdentifier) name : new NameToIdentifier(name)); this.name = name; isNameSupplied = true; }
/** * Returns the name as an {@code Identifier}, which is the type requested by ISO 19111. * Note that this is different than the type requested by ISO 19115, which is {@link MemberName}. * * This method is the converse of {@link #getMemberName(ParameterDescriptor)}. * * @return the parameter name as an identifier (the type specified by ISO 19111). */ @Override public synchronized ReferenceIdentifier getName() { if (name == null && memberName != null) { if (memberName instanceof ReferenceIdentifier) { name = (ReferenceIdentifier) memberName; } else { name = new NameToIdentifier(memberName); } } return name; }
/** * Returns the name as an {@code Identifier}, which is the type requested by ISO 19111. * Note that this is different than the type requested by ISO 19115, which is {@link MemberName}. * * This method is the converse of {@link #getMemberName(ParameterDescriptor)}. * * @return the parameter name as an identifier (the type specified by ISO 19111). */ @Override public synchronized ReferenceIdentifier getName() { if (name == null && memberName != null) { if (memberName instanceof ReferenceIdentifier) { name = (ReferenceIdentifier) memberName; } else { name = new NameToIdentifier(memberName); } } return name; }