public class TLcdS57FeatureObject extends Object implements ILcdDataObject,ILcdFeatured, ILcdCloneable
ILcdS57FeatureObject
.
The ILcdDataObject
interface is only supported if the ILcdS57Identifier
identifier that is configured on this object is an instance of TLcdS57Identifier
(the
ILcdS57Identifier
interface does not provide access to the object class descriptor and
data type of the S-57 object class, only the concrete class TLcdS57Identifier
does). In
case the interface is not supported, the data type of this object will be
TLcdUnknownDataTypes.UNKNOWN_TYPE
, and it will have no properties.AREA, LINE, NONE, POINT
Constructor and Description |
---|
TLcdS57FeatureObject() |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aIndex)
Checks whether the specified feature is editable.
|
Object |
clone()
Makes
Object.clone() public. |
boolean |
equals(Object o) |
TLcdDataType |
getDataType()
Returns the type of this data object.
|
Object |
getFeature(int aIndex)
Returns the feature
Object at the given index. |
int |
getFeatureCount()
Returns the number of features.
|
int |
getGroup()
Returns the group to which the S-57 object belongs, this can be 1 (= skin of the earth)
or 2 (= all other objects).
|
ILcdS57Identifier |
getIdentifier()
Gets the identifier of this shape.
|
ILcdS57Relationship |
getRelationship(int aIndex)
Returns the relationship at index
aIndex . |
int |
getRelationshipCount()
Returns the number of relationships in which this S-57 object is involved.
|
int |
getShape()
Gets the type of the shape:
POINT , LINE , AREA or
NONE . |
Object |
getValue(String aPropertyName)
Convenience method that returns the value of the property with the given name.
|
Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
int |
hashCode() |
boolean |
hasValue(String aPropertyName)
Indicates whether this data object has a value for the given property.
|
boolean |
hasValue(TLcdDataProperty aProperty)
Indicates whether this data object has a value for the given property.
|
void |
setFeature(int aIndex,
Object aFeature)
Sets the feature
Object at the given index. |
void |
setGroup(int aGroup)
Sets the group to which the S-57 object belongs, this can be 1 (= skin of the earth) or 2 (=
all other objects).
|
void |
setIdentifier(ILcdS57Identifier aIdentifier)
Set the identifier of this object.
|
void |
setRelationships(ILcdS57Relationship[] aRelationships)
Sets the relationships in which this S-57 object is involved.
|
void |
setValue(String aPropertyName,
Object aValue)
Convenience method that sets the value of the property with the given name.
|
void |
setValue(TLcdDataProperty aProperty,
Object aValue)
Sets the value of the given property for this data object.
|
String |
toString() |
public TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
public Object getValue(TLcdDataProperty aProperty)
ILcdDataObject
Returns the value of the given property.
If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).
The property must not be null, and must be declared in the data object's type
or in one of its super types.
Otherwise an IllegalArgumentException
is thrown.
getValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be returnedpublic Object getValue(String aPropertyName)
ILcdDataObject
Convenience method that returns the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.getValue(TLcdDataProperty)
for more information.getValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be returnedTLcdDataType.getProperty(String)
public void setValue(TLcdDataProperty aProperty, Object aValue)
ILcdDataObject
Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's type
or in one of its super types. In
other words, getDataType().getProperties().contains( aProperty ) should always be true.
Otherwise, the implementation should throw an IllegalArgumentException
.setValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public void setValue(String aPropertyName, Object aValue)
ILcdDataObject
Convenience method that sets the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.setValue(TLcdDataProperty, Object)
for more information.setValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to setpublic boolean hasValue(TLcdDataProperty aProperty)
ILcdDataObject
aProperty
is from the right data type
, and this instance has a value for it: returns true
aProperty
is from the right data type
, and this instance has no value for it: returns false
aProperty
is not from the right data type
: not allowed, you will get IllegalArgumentExceptionaProperty
is null
: not allowed, you will get NullPointerExceptionhasValue
in interface ILcdDataObject
aProperty
- the property for which to return whether a value is present or not.true
if this data object has a value for the given property, false
otherwise.public boolean hasValue(String aPropertyName)
ILcdDataObject
ILcdDataObject.hasValue(TLcdDataProperty)
for more information.hasValue
in interface ILcdDataObject
aPropertyName
- the name of the property for which to return whether a value is present
or not.true
if this data object has a value for the property with the given name,
false
otherwise.public boolean canSetFeature(int aIndex)
ILcdFeatured
canSetFeature
in interface ILcdFeatured
aIndex
- a valid feature index.public Object getFeature(int aIndex) throws IndexOutOfBoundsException
ILcdFeatured
Object
at the given index.getFeature
in interface ILcdFeatured
aIndex
- a valid feature index.Object
at the given index.IndexOutOfBoundsException
- when an index is chosen greater than the result of getFeatureCount.ILcdFeatured.setFeature(int, java.lang.Object)
public int getFeatureCount()
ILcdFeatured
getFeatureCount
in interface ILcdFeatured
public void setFeature(int aIndex, Object aFeature) throws IllegalArgumentException
ILcdFeatured
Object
at the given index.setFeature
in interface ILcdFeatured
aIndex
- a valid feature index.aFeature
- the new feature Object
.IllegalArgumentException
- if the feature can't be set.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public void setIdentifier(ILcdS57Identifier aIdentifier)
aIdentifier
- the S-57 identifier to be set on this object.public void setGroup(int aGroup)
public void setRelationships(ILcdS57Relationship[] aRelationships)
relationship.getFirstObject() == this || relationship.getSecondObject() == thisIf this object is not involved in any relationship, this method should be called with argument
null
.aRelationships
- the array of relationships in which this object is involed.public ILcdS57Identifier getIdentifier()
ILcdS57FeatureObject
public int getGroup()
ILcdS57FeatureObject
public int getShape()
ILcdS57FeatureObject
POINT
, LINE
, AREA
or
NONE
.public int getRelationshipCount()
ILcdS57FeatureObject
public ILcdS57Relationship getRelationship(int aIndex)
ILcdS57FeatureObject
aIndex
.aIndex
- index of the relationship to returnpublic Object clone()
ILcdCloneable
Makes Object.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 );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()