Class TLcdFeatureArray

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

public class TLcdFeatureArray extends Object implements ILcdFeatured
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

    • TLcdFeatureArray

      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

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

    • setFeatures

      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

      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

      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

      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

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