Class AbstractFeature

java.lang.Object
noaa.coastwatch.render.feature.AbstractFeature
All Implemented Interfaces:
Iterable<EarthLocation>, Feature
Direct Known Subclasses:
LineFeature, PointFeature

public abstract class AbstractFeature extends Object implements Feature
  • Field Details

  • Constructor Details

    • AbstractFeature

      protected AbstractFeature(List<EarthLocation> points)
      Creates a new feature with no attributes.
      Parameters:
      points - the list of points to use for this feature, or null to not create a list of points. In this case, the child class is responsible for the feature points.
    • AbstractFeature

      protected AbstractFeature()
      Creates a new feature with no attributes. The list of points is created and initialized to be empty.
  • Method Details

    • getAttribute

      public Object getAttribute(int index)
      Description copied from interface: Feature
      Gets the value of the specified attribute.
      Specified by:
      getAttribute in interface Feature
      Parameters:
      index - the index of the attribute to get.
      Returns:
      the attribute value (possibly null).
    • setAttributes

      protected void setAttributes(Object[] attributeArray)
      Sets the attribute array.
      Parameters:
      attributeArray - the array of feature attributes.
    • iterator

      public Iterator<EarthLocation> iterator()
      Description copied from interface: Feature
      Gets an iterator over the points associated with this feature.
      Specified by:
      iterator in interface Feature
      Specified by:
      iterator in interface Iterable<EarthLocation>
      Returns:
      the iterator over points.
    • add

      public void add(EarthLocation point)
      Adds a new point to this feature.
    • get

      public EarthLocation get(int index)
      Gets a point from this feature.
    • size

      public int size()
      Gets the total number of points in this feature.
    • remove

      public EarthLocation remove(int index)
      Removes a point from this feature.
    • addAll

      public void addAll(Feature feature)
      Adds a number of points from another feature to this feature.
    • getAttributeCount

      public int getAttributeCount()
      Description copied from interface: Feature
      Gets the number of attributes.
      Specified by:
      getAttributeCount in interface Feature
      Returns:
      the attribute count.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object