Class TLcdSegmentBasedRoute

java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdShapeList
com.luciad.ais.model.route.TLcdSegmentBasedRoute
All Implemented Interfaces:
ILcdEditableRoute, ILcdRoute, ILcdDataObject, ILcdBounded, ILcdShape, ILcdShapeList, ILcdCache, ILcdCloneable, ILcdInvalidateable, Serializable, Cloneable
Direct Known Subclasses:
TLcdATSRoute, TLcdMilitaryTrainingRoute

public class TLcdSegmentBasedRoute extends ALcdShapeList implements ILcdEditableRoute
An implementation of ILcdRoute. This class implements ILcdShapeList. The route is separated into shapes by looking for disjoint segments. The getShape() method returns an ILcd3DEditablePolyline. The method always returns a clone of the instance that is set by set3DEditablePolyline(ILcd3DEditablePolyline), so this instance must be set by the user prior to using any other methods!
See Also:
  • Field Details

    • SEGMENTS_PROPERTY

      public static final TLcdDataProperty SEGMENTS_PROPERTY
      The Segments property of the segment based route type. Values of this property are Lists of objects of type ILcdRouteSegment.
  • Constructor Details

    • TLcdSegmentBasedRoute

      @Deprecated public TLcdSegmentBasedRoute()
      Default constructor.
    • TLcdSegmentBasedRoute

      public TLcdSegmentBasedRoute(TLcdDataType aDataType)
      Creates a new instance for the given type.
      Parameters:
      aDataType - the data type of the returned instance
      Throws:
      IllegalArgumentException - if TLcdAISDataTypes.Route is not assignable from the given data type
      Since:
      10.1
    • TLcdSegmentBasedRoute

      public TLcdSegmentBasedRoute(TLcdSegmentBasedRoute aSegmentBasedRoute)
      Copy constructor.
      Parameters:
      aSegmentBasedRoute - the object to be copied
  • Method Details

    • getDataType

      public TLcdDataType getDataType()
      Description copied from interface: ILcdDataObject
      Returns the type of this data object. This can never be null.
      Specified by:
      getDataType in interface ILcdDataObject
      Returns:
      the type of this data object
    • getValue

      public Object getValue(TLcdDataProperty aProperty)
      Description copied from interface: 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.

      Specified by:
      getValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which the value is to be returned
      Returns:
      the value of the given property for this data object
    • getValue

      public Object getValue(String aPropertyName)
      Description copied from interface: 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).

      See ILcdDataObject.getValue(TLcdDataProperty) for more information.

      Specified by:
      getValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property of which the value is to be returned
      Returns:
      the value of the property with the given name
      See Also:
    • setValue

      public void setValue(TLcdDataProperty aProperty, Object aValue)
      Description copied from interface: 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 the data 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.

      Specified by:
      setValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which the value is to be set
      aValue - the value to set
      See Also:
    • setValue

      public void setValue(String aPropertyName, Object aValue)
      Description copied from interface: 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).

      See ILcdDataObject.setValue(TLcdDataProperty, Object) for more information.

      Specified by:
      setValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property of which the value is to be set
      aValue - the value to set
    • hasValue

      public boolean hasValue(TLcdDataProperty aProperty)
      Description copied from interface: ILcdDataObject
      Indicates whether this data object has a value for the given property.

      • 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 IllegalArgumentException
      • aProperty is null: not allowed, you will get NullPointerException

      A multivalued property is considered to have a value if it has at least one value.

      Specified by:
      hasValue in interface ILcdDataObject
      Parameters:
      aProperty - the property for which to return whether a value is present or not.
      Returns:
      true if this data object has a value for the given property, false otherwise.
    • hasValue

      public boolean hasValue(String aPropertyName)
      Description copied from interface: ILcdDataObject
      Indicates whether this data object has a value for the given property.
      See ILcdDataObject.hasValue(TLcdDataProperty) for more information.
      Specified by:
      hasValue in interface ILcdDataObject
      Parameters:
      aPropertyName - the name of the property for which to return whether a value is present or not.
      Returns:
      true if this data object has a value for the property with the given name, false otherwise.
    • set3DEditablePolyline

      public void set3DEditablePolyline(ILcd3DEditablePolyline aPolyline)
      Sets the polyline that will be cloned to create the lines that are returned by the getShape() method.
      Parameters:
      aPolyline - the polyline that will be cloned to create the lines that are returned by the getShape() method.
    • getSegment

      public ILcdRouteSegment getSegment(int aIndex)
      Description copied from interface: ILcdRoute
      Returns the segment at the specified index.
      Specified by:
      getSegment in interface ILcdRoute
      Parameters:
      aIndex - the index of the segment to be retrieved
      Returns:
      the segment at the specified index.
    • getSegmentCount

      public int getSegmentCount()
      Description copied from interface: ILcdRoute
      Returns the number of segments of this route.
      Specified by:
      getSegmentCount in interface ILcdRoute
      Returns:
      the number of segments of this route.
    • getShapeCount

      public int getShapeCount()
      Description copied from interface: ILcdShapeList
      Returns the number of ILcdShape objects in the list.
      Specified by:
      getShapeCount in interface ILcdShapeList
      Returns:
      the number of ILcdShape objects in the list.
    • getShape

      public ILcdShape getShape(int aShapeNumber) throws IndexOutOfBoundsException
      Description copied from interface: ILcdShapeList
      Returns the ILcdShape at the given index.
      Specified by:
      getShape in interface ILcdShapeList
      Parameters:
      aShapeNumber - a valid index in the list of ILcdShape objects.
      Returns:
      the ILcdShape at the given index.
      Throws:
      IndexOutOfBoundsException - when the index is not valid.
    • clone

      public Object clone()
      Returns a clone of this TLcdSegmentBasedRoute object. Note: the internal polyline (see set3DEditablePolyline(ILcd3DEditablePolyline)) of the new object is a clone of the polyline of this object. Other features are a shallow clone.
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALcdShapeList
      Returns:
      a clone of this TLcdSegmentBasedRoute object.
      See Also:
    • equals

      public boolean equals(Object aObject)
      Returns true if this object is the same as the specified object.
      Overrides:
      equals in class ALcdShapeList
      Parameters:
      aObject - the reference object with which to compare.
      Returns:
      True if this object is the same as the specified object.
    • hashCode

      public int hashCode()
      Description copied from class: ALcdShape
      The hash code of this shape is the hash code of its class, in order to be consistent with the ALcdShape.equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class ALcdShapeList
    • addSegmentBySequenceNumber

      public int addSegmentBySequenceNumber(ILcdRouteSegment aSegment)
      Description copied from interface: ILcdEditableRoute
      Adds a segment to this route. The position at which the segment is inserted is determined by looking at the segment's sequence number.
      Specified by:
      addSegmentBySequenceNumber in interface ILcdEditableRoute
      Parameters:
      aSegment - the ILcdRouteSegment to be added.
      Returns:
      the position of the added segment in this route
    • insertSegmentAt

      public int insertSegmentAt(ILcdRouteSegment aSegment, int aIndex)
      Description copied from interface: ILcdEditableRoute
      Adds a segment to this route at the specified index.
      Specified by:
      insertSegmentAt in interface ILcdEditableRoute
      Parameters:
      aSegment - the ILcdRouteSegment to be added.
      aIndex - the index at which the segment is to be inserted
      Returns:
      the position of the added segment in this route
    • removeSegment

      public void removeSegment(ILcdRouteSegment aSegment)
      Description copied from interface: ILcdEditableRoute
      Removes a ILcdRouteSegment object from this route.
      Specified by:
      removeSegment in interface ILcdEditableRoute
      Parameters:
      aSegment - the ILcdRouteSegment object to be removed
    • removeSegmentAt

      public void removeSegmentAt(int aIndex)
      Description copied from interface: ILcdEditableRoute
      Removes the ILcdRouteSegment object on the specified index from the ILcdEditableRoute.
      Specified by:
      removeSegmentAt in interface ILcdEditableRoute
      Parameters:
      aIndex - the index in the ILcdEditableRoute where the ILcdRouteSegment object must be removed