Package com.luciad.format.s57
Class TLcdS57Identifier
java.lang.Object
com.luciad.format.s57.TLcdS57Identifier
- All Implemented Interfaces:
ILcdS57Identifier
,ILcdCloneable
,ILcdFeatured
,Serializable
,Cloneable
public class TLcdS57Identifier
extends Object
implements ILcdS57Identifier, Serializable, ILcdFeatured, ILcdCloneable
An implementation of the
ILcdS57Identifier
interface.- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdS57Identifier
(int aObjectClassCode, ILcdS57Attribute[] aAttributes) Constructs a new S-57 editable identifier, initialized with the given object class code.TLcdS57Identifier
(TLcdS57ObjectClassDescriptor aObjectClassDescriptor, ILcdS57Attribute[] aAttributes) Constructs a new S-57 editable identifier, initialized with the given object class descriptor.TLcdS57Identifier
(TLcdS57ObjectClassDescriptor aObjectClassDescriptor, ILcdS57Attribute[] aAttributes, int aIdentifier) Constructs a new S-57 editable identifier, initialized with the given object class descriptor.TLcdS57Identifier
(TLcdS57ObjectClassDescriptor aObjectClassDescriptor, ILcdS57Attribute[] aAttributes, int aIdentifier, long aLongName) Constructs a new S-57 editable identifier, initialized with the given object class descriptor, attributes, id and long name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(ILcdS57Attribute aAttribute) Adds the given attribute to this S-57 identifier.boolean
canSetFeature
(int aIndex) Checks whether the specified feature is editable.clone()
MakesObject.clone()
public.boolean
getFeature
(int aIndex) Returns the featureObject
at the given index.int
Returns the number of features.int
getId()
Returns the id of this S-57 identifier, uniquely identifying the S-57 feature within the model.long
Gets the "Long Name" of this S-57 feature object.Returns the S-57 object class descriptor, describing this identifier.getS57Attribute
(int aIndex) Gets the TLcdS57Attribute at a given index.int
Gets the number of TLcdS57Attributes stored in this identifier.getS57AttributeForCode
(int aRequestedCode) Gets the TLcdS57Attribute that has the given code.int
Gets the object class.int
hashCode()
boolean
isSimilar
(ILcdS57Identifier aIdentifier) Returns whether the given identifier is similar to this identifier, meaning they have the same object class and attribute values, but that the given identifier can have more attributes than this one.void
removeAttribute
(ILcdS57Attribute aAttribute) Removes the specified attribute from this S-57 identifier.void
setFeature
(int aIndex, Object aFeature) Sets the featureObject
at the given index.toString()
-
Constructor Details
-
TLcdS57Identifier
Constructs a new S-57 editable identifier, initialized with the given object class code. The attributes array should be ordered ascendingly according to the attribute code. The attributes array should be ordered ascendingly according to the attribute code. The attributes array should be ordered ascendingly according to the attribute code.- Parameters:
aObjectClassCode
-
-
TLcdS57Identifier
public TLcdS57Identifier(TLcdS57ObjectClassDescriptor aObjectClassDescriptor, ILcdS57Attribute[] aAttributes) Constructs a new S-57 editable identifier, initialized with the given object class descriptor. The attributes array should be ordered ascendingly according to the attribute code.- Parameters:
aObjectClassDescriptor
-
-
TLcdS57Identifier
public TLcdS57Identifier(TLcdS57ObjectClassDescriptor aObjectClassDescriptor, ILcdS57Attribute[] aAttributes, int aIdentifier) Constructs a new S-57 editable identifier, initialized with the given object class descriptor. The attributes array should be ordered ascendingly according to the attribute code.- Parameters:
aObjectClassDescriptor
-
-
TLcdS57Identifier
public TLcdS57Identifier(TLcdS57ObjectClassDescriptor aObjectClassDescriptor, ILcdS57Attribute[] aAttributes, int aIdentifier, long aLongName) Constructs a new S-57 editable identifier, initialized with the given object class descriptor, attributes, id and long name.- Parameters:
aObjectClassDescriptor
- The object class descriptor, leavenull
for an unknown descriptor.aAttributes
- The attributes, ordered ascendingly according to the attribute code.aIdentifier
- Theidentifier
, leave-1
if unknown.aLongName
- Thelong name
, leave-1
if unknown.- Since:
- 2017.0
-
-
Method Details
-
getId
public int getId()Returns the id of this S-57 identifier, uniquely identifying the S-57 feature within the model.- Returns:
- the id of this S-57 identifier, uniquely identifying the S-57 feature within the model.
-
getLongName
public long getLongName()Description copied from interface:ILcdS57Identifier
Gets the "Long Name" of this S-57 feature object. The "Long Name" is also known as "feature object identifier", or LNAM. It is a representation of the FOID (Feature Object Identifier) fields. More specifically, it is a "binary concatenation"(FIDS << 48) | (FIDN << 16) | AGEN
, where:- AGEN (Producing Agency)
- FIDN (Feature Identification Number)
- FIDS (Feature Identification Subdivision)
- Specified by:
getLongName
in interfaceILcdS57Identifier
- Returns:
- The long name, or -1 if unknown
-
getObjectClassDescriptor
Returns the S-57 object class descriptor, describing this identifier.- Returns:
- the S-57 object class descriptor, describing this identifier.
-
addAttribute
Adds the given attribute to this S-57 identifier. If an attribute with the same code already exists, it is replaced by the new one.- Parameters:
aAttribute
- the attribute to be added to this S-57 identifier.
-
removeAttribute
Removes the specified attribute from this S-57 identifier.- Parameters:
aAttribute
- the attribute to be removed.- Throws:
IllegalArgumentException
- if the specified attribute is not an attribute of this S-57 identifier.
-
getS57ObjectClass
public int getS57ObjectClass()Description copied from interface:ILcdS57Identifier
Gets the object class.- Specified by:
getS57ObjectClass
in interfaceILcdS57Identifier
-
getS57AttributeCount
public int getS57AttributeCount()Description copied from interface:ILcdS57Identifier
Gets the number of TLcdS57Attributes stored in this identifier.- Specified by:
getS57AttributeCount
in interfaceILcdS57Identifier
-
getS57Attribute
Description copied from interface:ILcdS57Identifier
Gets the TLcdS57Attribute at a given index.- Specified by:
getS57Attribute
in interfaceILcdS57Identifier
-
getS57AttributeForCode
Description copied from interface:ILcdS57Identifier
Gets the TLcdS57Attribute that has the given code.- Specified by:
getS57AttributeForCode
in interfaceILcdS57Identifier
-
isSimilar
Description copied from interface:ILcdS57Identifier
Returns whether the given identifier is similar to this identifier, meaning they have the same object class and attribute values, but that the given identifier can have more attributes than this one.- Specified by:
isSimilar
in interfaceILcdS57Identifier
-
canSetFeature
public boolean canSetFeature(int aIndex) Description copied from interface:ILcdFeatured
Checks whether the specified feature is editable.- Specified by:
canSetFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- a valid feature index.- Returns:
- true if the feature can be set, false otherwise.
-
getFeature
Description copied from interface:ILcdFeatured
Returns the featureObject
at the given index.- Specified by:
getFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- a valid feature index.- Returns:
- the feature
Object
at the given index. - Throws:
IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.- See Also:
-
getFeatureCount
public int getFeatureCount()Description copied from interface:ILcdFeatured
Returns the number of features.- Specified by:
getFeatureCount
in interfaceILcdFeatured
- Returns:
- the number of features.
-
setFeature
Description copied from interface:ILcdFeatured
Sets the featureObject
at the given index.- Specified by:
setFeature
in interfaceILcdFeatured
- Parameters:
aIndex
- a valid feature index.aFeature
- the new featureObject
.- Throws:
IllegalArgumentException
- if the feature can't be set.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.java.lang.Object
, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-