public class TLcd2DEditableFeaturedPoint extends Object implements ILcd2DEditablePoint,ILcdFeatured, ILcdDataObject
ILcd2DEditablePoint
and ILcdFeatured
.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
Constructor and Description |
---|
TLcd2DEditableFeaturedPoint()
Constructs a
TLcd2DEditableFeaturedPoint that doesn't have any ILcd2DEditablePoint object,
features, or display name. |
TLcd2DEditableFeaturedPoint(String aDisplayName)
Constructs a
TLcd2DEditableFeaturedPoint that doesn't have any ILcd2DEditablePoint object or
features, with the given display name. |
TLcd2DEditableFeaturedPoint(String aDisplayName,
ILcdFeatured aFeaturesObject)
Constructs a
TLcd2DEditableFeaturedPoint that doesn't have any ILcd2DEditablePoint object,
with the given features and display name. |
TLcd2DEditableFeaturedPoint(String aDisplayName,
ILcdFeatured aFeaturesObject,
ILcd2DEditablePoint a2DEditablePoint)
Constructs a
TLcd2DEditableFeaturedPoint with the given ILcd2DEditablePoint ,
features and display name. |
TLcd2DEditableFeaturedPoint(TLcd2DEditableFeaturedPoint a2DEditableFeaturedPoint)
Constructs a
TLcd2DEditableFeaturedPoint that is a clone of the given
TLcd2DEditableFeaturedPoint . |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetFeature(int aIndex)
Checks whether the specified feature is editable.
|
Object |
clone()
Creates and returns a copy of this object.
|
ILcd2DEditablePoint |
cloneAs2DEditablePoint()
Returns a copy of this
ILcdPoint that is also an ILcd2DEditablePoint . |
ILcd3DEditablePoint |
cloneAs3DEditablePoint()
Returns a copy of this
ILcdPoint that is also an ILcd3DEditablePoint . |
boolean |
contains2D(double aX,
double aY)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 2D space. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Checks whether this
ILcdShape contains the given point in
the 3D space. |
boolean |
contains3D(ILcdPoint aPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 3D space. |
boolean |
equals(Object aObject)
Returns whether the given object has the same class, the same coordinates,
the same features, and the same display name.
|
ILcd2DEditablePoint |
get2DEditablePoint() |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
double |
getCosX()
Returns cos(
getX() * DEG2RAD ). |
double |
getCosY()
Returns cos(
getY() * DEG2RAD ). |
TLcdDataType |
getDataType()
Returns the type of this data object.
|
int |
getDefaultDisplayNameIndex() |
String |
getDisplayName() |
Object |
getFeature(int aIndex)
Returns the feature
Object at the given index. |
int |
getFeatureCount()
Returns the number of features.
|
ILcdFeatured |
getFeatures() |
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
double |
getSinX()
Returns sin(
getX() * DEG2RAD ). |
double |
getSinY()
Returns sin(
getY() * DEG2RAD ). |
double |
getTanX()
Returns tan(
getX() * DEG2RAD ). |
double |
getTanY()
Returns tan(
getY() * DEG2RAD ). |
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.
|
double |
getX()
Returns the x coordinate of this
ILcdPoint . |
double |
getY()
Returns the y coordinate of this
ILcdPoint . |
double |
getZ()
Returns the z coordinate of this
ILcdPoint . |
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 |
move2D(double aX,
double aY)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
void |
move2D(ILcdPoint aPoint)
Moves this
ILcd2DEditableShape to the given point in the 2D space. |
void |
set2DEditablePoint(ILcd2DEditablePoint a2DEditablePoint) |
void |
setDefaultDisplayNameIndex(int aDefaultDisplayNameIndex)
Sets the index of the feature to use as display name, if the display name has
not been specified explicitly.
|
void |
setFeature(int aIndex,
Object aFeature)
Sets the feature
Object at the given index. |
void |
setFeatures(ILcdFeatured aFeatures) |
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()
Returns the display name.
|
void |
translate2D(double aDeltaX,
double aDeltaY)
Translates this
ILcd2DEditableShape from its current position over the given translation
vector in the 2D space. |
public TLcd2DEditableFeaturedPoint()
TLcd2DEditableFeaturedPoint
that doesn't have any ILcd2DEditablePoint
object,
features, or display name.public TLcd2DEditableFeaturedPoint(String aDisplayName)
TLcd2DEditableFeaturedPoint
that doesn't have any ILcd2DEditablePoint
object or
features, with the given display name.aDisplayName
- a display name.public TLcd2DEditableFeaturedPoint(String aDisplayName, ILcdFeatured aFeaturesObject)
TLcd2DEditableFeaturedPoint
that doesn't have any ILcd2DEditablePoint
object,
with the given features and display name.aDisplayName
- a display name.aFeaturesObject
- a set of features, that is, name/value pairs.public TLcd2DEditableFeaturedPoint(String aDisplayName, ILcdFeatured aFeaturesObject, ILcd2DEditablePoint a2DEditablePoint)
TLcd2DEditableFeaturedPoint
with the given ILcd2DEditablePoint
,
features and display name.a2DEditablePoint
- a 2D editable pointaDisplayName
- a display name.aFeaturesObject
- a set of features, that is, name/value pairs.public TLcd2DEditableFeaturedPoint(TLcd2DEditableFeaturedPoint a2DEditableFeaturedPoint)
TLcd2DEditableFeaturedPoint
that is a clone of the given
TLcd2DEditableFeaturedPoint
.public void set2DEditablePoint(ILcd2DEditablePoint a2DEditablePoint)
public ILcd2DEditablePoint get2DEditablePoint()
public double getX()
ILcdPoint
ILcdPoint
.public double getY()
ILcdPoint
ILcdPoint
.public double getZ()
ILcdPoint
ILcdPoint
.public double getSinX()
ILcdPoint
getX()
* DEG2RAD ).public double getSinY()
ILcdPoint
getY()
* DEG2RAD ).public double getCosX()
ILcdPoint
getX()
* DEG2RAD ).public double getCosY()
ILcdPoint
getY()
* DEG2RAD ).public double getTanX()
ILcdPoint
getX()
* DEG2RAD ).public double getTanY()
ILcdPoint
getY()
* DEG2RAD ).public ILcd3DEditablePoint cloneAs3DEditablePoint()
ILcdPoint
ILcdPoint
that is also an ILcd3DEditablePoint
.
This makes sure that all three dimensions of the copy are writable,cloneAs3DEditablePoint
in interface ILcdPoint
ILcdPoint
that is also an ILcd3DEditablePoint
.
This makes sure that all three dimensions of the copy are writable,
even if the original ILcdPoint
object may be read-only.ILcd3DEditablePoint
public ILcd2DEditablePoint cloneAs2DEditablePoint()
ILcdPoint
ILcdPoint
that is also an ILcd2DEditablePoint
.
This makes sure that the first two dimensions of the copy are writable,cloneAs2DEditablePoint
in interface ILcdPoint
ILcdPoint
that is also an ILcd2DEditablePoint
.
This makes sure that the first two dimensions of the copy are writable,
even if the original ILcdPoint
object may be read-only.ILcd2DEditablePoint
public ILcdPoint getFocusPoint()
ILcdShape
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public boolean contains3D(double aX, double aY, double aZ)
ILcdShape
ILcdShape
contains the given point in
the 3D space.contains3D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public boolean contains3D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 3D space.contains3D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains3D(double, double, double)
public boolean contains2D(double aX, double aY)
ILcdShape
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public boolean contains2D(ILcdPoint aPoint)
ILcdShape
ILcdShape
contains the given ILcdPoint
in the 2D space.
Only the first two dimensions of the ILcdShape
and the ILcdPoint
are considered.contains2D
in interface ILcdShape
aPoint
- the ILcdPoint
to test.ILcdShape.contains2D(double, double)
public void translate2D(double aDeltaX, double aDeltaY)
ILcd2DEditableShape
ILcd2DEditableShape
from its current position over the given translation
vector in the 2D space. Only the first two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.translate2D
in interface ILcd2DEditableShape
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.public void move2D(double aX, double aY)
ILcd2DEditableShape
ILcd2DEditableShape
to the given point in the 2D space. The focus point
is used as the handle by which the shape is moved. Only the first
two dimensions of the ILcdShape
are considered.
The third dimension is left unchanged.move2D
in interface ILcd2DEditableShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public void move2D(ILcdPoint aPoint)
ILcd2DEditableShape
ILcd2DEditableShape
to the given point in the 2D space. The focus point
is used as the handle by which the shape is moved. Only the first
two dimensions of the ILcdShape
and the ILcdPoint
are considered.
The third dimension is left unchanged.move2D
in interface ILcd2DEditableShape
aPoint
- the ILcdPoint
to move to.ILcd2DEditableShape.move2D(double, double)
public int getFeatureCount()
ILcdFeatured
getFeatureCount
in interface ILcdFeatured
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 ILcdFeatured getFeatures()
public void setFeature(int aIndex, Object aFeature)
ILcdFeatured
Object
at the given index.setFeature
in interface ILcdFeatured
aIndex
- a valid feature index.aFeature
- the new feature Object
.ILcdFeatured.getFeature(int)
,
ILcdFeatured.canSetFeature(int)
public boolean canSetFeature(int aIndex)
ILcdFeatured
canSetFeature
in interface ILcdFeatured
aIndex
- a valid feature index.public void setFeatures(ILcdFeatured aFeatures)
public String getDisplayName()
public void setDefaultDisplayNameIndex(int aDefaultDisplayNameIndex)
aDefaultDisplayNameIndex
- a valid index in the list of features.public int getDefaultDisplayNameIndex()
public Object clone()
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public boolean equals(Object aObject)
equals
in interface ILcdPoint
equals
in class Object
aObject
- the Object
to compare to.public String toString()
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 TLcdDataType getDataType()
ILcdDataObject
null
.getDataType
in interface ILcdDataObject
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 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(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.