Class TLcdFeatureArray

java.lang.Object
com.luciad.util.TLcdFeatureArray
All Implemented Interfaces:
ILcdCloneable, ILcdFeatured, Serializable, Cloneable
Direct Known Subclasses:
TLcdFeaturedMultiShapeList, TLcdFeaturedSingleShapeList

public class TLcdFeatureArray extends Object implements ILcdFeatured, ILcdCloneable
Array based implementation to hold values for the features of an object. The array is extensible in the sense that a value can be set at any index. The internal representation is adapted to hold at least the number of values equal to the index passed plus one.
See Also:
  • Constructor Details Link icon

    • TLcdFeatureArray Link icon

      public TLcdFeatureArray()
      Creates a feature array containing no values for features. Set the value of at least one feature at an index i before requesting the value of a feature with index smaller than i.
    • TLcdFeatureArray Link icon

      public TLcdFeatureArray(Object[] aFeatureArray)
      Creates a feature array by passing the values of the features.
      Parameters:
      aFeatureArray - the values of the features.
  • Method Details Link icon

    • setFeatures Link icon

      public void setFeatures(Object[] aFeatureArray)
      Sets the values of all features at once. Note that no features at an index beyond the length of this array can be retrieved unless a value is set at an index equal to or higher than the length.
      Parameters:
      aFeatureArray - the values of the features.
    • getFeatureCount Link icon

      public int getFeatureCount()
      The highest index for which a feature value was set. Note that the feature value may have been null.
      Specified by:
      getFeatureCount in interface ILcdFeatured
      Returns:
      highest index for which a feature value was set. Note that the feature value may have been null.
    • getFeature Link icon

      public Object getFeature(int aIndex) throws IndexOutOfBoundsException
      Returns the value of the feature at the given index when a value is set for that index or a higher index. Otherwise an IndexOutOfBoundsException is thrown.
      Specified by:
      getFeature in interface ILcdFeatured
      Parameters:
      aIndex - the index of the value to retrieve a value for.
      Returns:
      the value of the feature at the given index.
      Throws:
      IndexOutOfBoundsException - when the index passed is higher than the highest index for which a value was set.
      See Also:
    • setFeature Link icon

      public void setFeature(int aIndex, Object aFeature)
      Sets the value for a feature at the given index. The internal representation will be extended to be able to contain at least aIndex+1 features.
      Specified by:
      setFeature in interface ILcdFeatured
      Parameters:
      aIndex - the index of the feature for which the value is intended for.
      aFeature - the value of the feature.
      See Also:
    • canSetFeature Link icon

      public boolean canSetFeature(int aIndex)
      Always returns true.
      Specified by:
      canSetFeature in interface ILcdFeatured
      Parameters:
      aIndex - not taken into account.
      Returns:
      always true.
    • clone Link icon

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from 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 interface ILcdCloneable
      Overrides:
      clone in class Object
      See Also: