public class TLcdS57Line extends TLcdXYPolyline implements ILcdS57Object, ILcdDataObject,ILcdFeatured, ILcdInvalidateable, Serializable
fBounds, fFocusPoint
AREA, LINE, NONE, POINT
INTERPOLATION_CIRCLE_BY_3POINTS, INTERPOLATION_CIRCLE_BY_CENTERPOINT, INTERPOLATION_CIRCULARARC_BY_3POINTS, INTERPOLATION_CIRCULARARC_BY_BULGE, INTERPOLATION_CIRCULARARC_BY_CENTERPOINT, INTERPOLATION_ELLIPTICAL, INTERPOLATION_GEODESIC, INTERPOLATION_LINEAR, INTERPOLATION_MIXED, INTERPOLATION_RHUMB
Constructor and Description |
---|
TLcdS57Line(ILcd2DEditablePointList aPointList)
Deprecated.
This constructor should no longer be used. Use the constructor with edges instead.
|
TLcdS57Line(TLcdS57FeatureObject aFeatureObject,
TLcdS57Edge[] aEdges,
int[] aEdgeOrientations,
int[] aEdgeUsages,
int[] aEdgeMasks)
Creates a new S-57 Line feature with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateBounds()
Computes the bounds of the polypoint.
|
boolean |
canSetFeature(int aIndex)
Checks whether the specified feature is editable.
|
void |
clearCache()
Clears the cache.
|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
contains2D(double aX,
double aY)
Checks if the point
(aX,aY) lies on one of the line segments of the
TLcdXYPolyline . |
boolean |
equals(Object o)
Returns whether the given object has the same class, the same focus point,
and the same coordinates.
|
TLcdDataType |
getDataType()
Returns the type of this data object.
|
TLcdS57Edge |
getEdge(int aIndex)
Returns the edge that is part of this line, at the given index.
|
int |
getEdgeCount()
Returns the number of edges this line consists of.
|
int |
getEdgeMask(int aIndex)
Returns the mask of the edge that is part of this line, at the given index.
|
int |
getEdgeOrientation(int aIndex)
Returns the orientation of the edge that is part of this line, at the given index.
|
int |
getEdgeUsage(int aIndex)
Returns the usage of the edge that is part of this line, at the given index.
|
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.
|
float |
getMaximumDepth()
Returns the maximum depth of this line and of containing and intersecting DEPARE and DRGARE
objects (only applicable for OBSTRN, UWTROC, and WRECK lines).
|
float |
getMinimumAdjacentDepth()
Returns the minimum depth of this line and of adjacent DEPARE and DRGARE objects (only
applicable for DEPARE and DEPCNT lines).
|
float |
getMinimumDepth()
Returns the minimum depth of this line and of containing and intersecting DEPARE and DRGARE
objects (only applicable for OBSTRN, UWTROC, and WRECK lines).
|
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()
The hash code of this shape is the hash code of its class, in order to
be consistent with the
ALcdShape.equals(Object) method. |
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 |
invalidateObject()
Invalidates all cached values of this object.
|
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 |
setMaximumDepth(float aMaximumDepth)
Sets the maximum depth of this line and of containing and intersecting DEPARE and DRGARE
objects (only applicable for OBSTRN, UWTROC, and WRECK lines).
|
void |
setMinimumAdjacentDepth(float aMinimumAdjacentDepth)
Sets the minimum depth of this line and of adjacent DEPARE and DRGARE objects (only applicable
for DEPARE and DEPCNT lines).
|
void |
setMinimumDepth(float aMinimumDepth)
Sets the minimum depth of this line and of containing and intersecting DEPARE and DRGARE
objects (only applicable for OBSTRN, UWTROC, and WRECK lines).
|
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() |
computePointSFCT, getEndPoint, getEndTangent2D, getInterpolation, getLength2D, getLineSegmentIntersectionCount, getStartPoint, getStartTangent2D, getTangent2D
calculateFocusPoint
get2DEditablePointList, getBounds, getCachedObject, getFocusPoint, getPoint, getPointCount, getPointSFCT, getX, getY, getZ, insert2DPoint, insertIntoCache, invalidateBounds, move2D, move2DPoint, removeCachedObject, removePointAt, set2DEditablePointList, setFocusPoint, translate2D, translate2DPoint
contains3D, move2D
contains2D, contains3D, fromDomainObject
finalize, getClass, notify, notifyAll, wait, wait, wait
contains2D, contains3D, contains3D, getFocusPoint
getBounds
move2D, move2D, translate2D
append2DPoint, insert2DPoint, move2DPoint, removePointAt, translate2D, translate2DPoint
getPoint, getPointCount, getPointSFCT, getX, getY, getZ
getCachedObject, insertIntoCache, removeCachedObject
public TLcdS57Line(ILcd2DEditablePointList aPointList)
aPointList
- the geometry defining the geographical extent for this Line feature.public TLcdS57Line(TLcdS57FeatureObject aFeatureObject, TLcdS57Edge[] aEdges, int[] aEdgeOrientations, int[] aEdgeUsages, int[] aEdgeMasks)
aFeatureObject
- the S-57 feature object describing the object class and
attributes of this Line feature.aEdges
- the edges defining the geographical extent of this Line feature.aEdgeOrientations
- array containing for each edge the orientation in which it should be
traversed. See getEdgeOrientation(int)
for more information
on allowable values.aEdgeUsages
- array containing for each edge the usage of the edge. See getEdgeUsage(int)
for more information on allowable values.aEdgeMasks
- array containing for each edge the mask of the edge. See getEdgeMask(int)
for more information on allowable values.public int getEdgeCount()
public TLcdS57Edge getEdge(int aIndex)
aIndex
- the edge that is part of this line, at the given index.public int getEdgeOrientation(int aIndex)
TLcdS57Constants.ORIENTATION_FORWARD
or TLcdS57Constants.ORIENTATION_REVERSE
.aIndex
- the orientation of the edge that is part of this line, at the given index.public int getEdgeUsage(int aIndex)
TLcdS57Constants.USAGE_EXTERIOR
, TLcdS57Constants.USAGE_INTERIOR
or
TLcdS57Constants.USAGE_EXTERIOR_TRUNCATED
.aIndex
- the usage of the edge that is part of this line, at the given index.public int getEdgeMask(int aIndex)
TLcdS57Constants.MASK_MASK
, TLcdS57Constants.MASK_SHOW
or
TLcdS57Constants.MASK_NOT_APPLICABLE
.aIndex
- the mask of the edge that is part of this line, at the given index.public void setMinimumAdjacentDepth(float aMinimumAdjacentDepth)
minimumAdjacentDepth
property is part of the set of preprocessor variables.aMinimumAdjacentDepth
- the minimum depth of this line and of adjacent DEPARE and DRGARE
objects.getMinimumAdjacentDepth()
,
TLcdS57Preprocessor
public float getMinimumAdjacentDepth()
minimumAdjacentDepth
property is part of the set of preprocessor variables.setMinimumAdjacentDepth(float)
,
TLcdS57Preprocessor
public void setMinimumDepth(float aMinimumDepth)
minimumDepth
property is part of the set of preprocessor variables.aMinimumDepth
- the minimum depth of this line and of containing and intersecting DEPARE
and DRGARE
objectsgetMinimumDepth()
,
TLcdS57Preprocessor
public float getMinimumDepth()
minimumDepth
property is part of the set of preprocessor variables.setMinimumDepth(float)
,
TLcdS57Preprocessor
public void setMaximumDepth(float aMaximumDepth)
maximumDepth
property is part of the set of preprocessor variables.aMaximumDepth
- the maximum depth of this line and of containing and intersecting DEPARE
and DRGARE objects.getMaximumDepth()
,
TLcdS57Preprocessor
public float getMaximumDepth()
maximumDepth
property is part of the set of preprocessor variables.setMaximumDepth(float)
,
TLcdS57Preprocessor
public void invalidateObject()
ILcdInvalidateable
invalidateObject
in interface ILcdInvalidateable
invalidateObject
in class ALcd2DEditablePolypoint
public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
clearCache
in class ALcd2DEditablePolypoint
protected void calculateBounds()
ALcd2DEditablePolypoint
fBounds
.calculateBounds
in class TLcdXYPolypoint
public boolean contains2D(double aX, double aY)
(aX,aY)
lies on one of the line segments of the
TLcdXYPolyline
.contains2D
in interface ILcdShape
contains2D
in class TLcdXYPolyline
aX
- the x coordinate of the point.aY
- the y coordinate of the point.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
getIdentifier
in interface ILcdS57FeatureObject
public int getGroup()
ILcdS57FeatureObject
getGroup
in interface ILcdS57FeatureObject
public int getShape()
ILcdS57FeatureObject
POINT
, LINE
, AREA
or
NONE
.getShape
in interface ILcdS57FeatureObject
public int getRelationshipCount()
ILcdS57FeatureObject
getRelationshipCount
in interface ILcdS57FeatureObject
public ILcdS57Relationship getRelationship(int aIndex)
ILcdS57FeatureObject
aIndex
.getRelationship
in interface ILcdS57FeatureObject
aIndex
- index of the relationship to returnpublic 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 boolean equals(Object o)
ALcd2DEditablePolypoint
equals
in class ALcd2DEditablePolypoint
public int hashCode()
ALcdShape
ALcdShape.equals(Object)
method.
Extensions should refine this implementation, based on their properties.hashCode
in class ALcd2DEditablePolypoint
public String toString()
toString
in class ALcd2DEditablePolypoint
public Object clone()
TLcdXYPolyline
clone
in interface ILcdCloneable
clone
in class TLcdXYPolyline
Object.clone()