Package noaa.coastwatch.render.feature
Class AbstractFeature
java.lang.Object
noaa.coastwatch.render.feature.AbstractFeature
- All Implemented Interfaces:
Iterable<EarthLocation>
,Feature
- Direct Known Subclasses:
LineFeature
,PointFeature
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new feature with no attributes.protected
AbstractFeature
(List<EarthLocation> points) Creates a new feature with no attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(EarthLocation point) Adds a new point to this feature.void
Adds a number of points from another feature to this feature.boolean
get
(int index) Gets a point from this feature.getAttribute
(int index) Gets the value of the specified attribute.int
Gets the number of attributes.int
hashCode()
iterator()
Gets an iterator over the points associated with this feature.remove
(int index) Removes a point from this feature.protected void
setAttributes
(Object[] attributeArray) Sets the attribute array.int
size()
Gets the total number of points in this feature.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
points
The list of feature points.
-
-
Constructor Details
-
AbstractFeature
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
Description copied from interface:Feature
Gets the value of the specified attribute.- Specified by:
getAttribute
in interfaceFeature
- Parameters:
index
- the index of the attribute to get.- Returns:
- the attribute value (possibly null).
-
setAttributes
Sets the attribute array.- Parameters:
attributeArray
- the array of feature attributes.
-
iterator
Description copied from interface:Feature
Gets an iterator over the points associated with this feature.- Specified by:
iterator
in interfaceFeature
- Specified by:
iterator
in interfaceIterable<EarthLocation>
- Returns:
- the iterator over points.
-
add
Adds a new point to this feature. -
get
Gets a point from this feature. -
size
public int size()Gets the total number of points in this feature. -
remove
Removes a point from this feature. -
addAll
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 interfaceFeature
- Returns:
- the attribute count.
-
equals
-
hashCode
public int hashCode()
-