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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new feature with no attributes.protectedAbstractFeature(List<EarthLocation> points) Creates a new feature with no attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(EarthLocation point) Adds a new point to this feature.voidAdds a number of points from another feature to this feature.booleanget(int index) Gets a point from this feature.getAttribute(int index) Gets the value of the specified attribute.intGets the number of attributes.inthashCode()iterator()Gets an iterator over the points associated with this feature.remove(int index) Removes a point from this feature.protected voidsetAttributes(Object[] attributeArray) Sets the attribute array.intsize()Gets the total number of points in this feature.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:FeatureGets the value of the specified attribute.- Specified by:
getAttributein 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:FeatureGets an iterator over the points associated with this feature.- Specified by:
iteratorin interfaceFeature- Specified by:
iteratorin 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:FeatureGets the number of attributes.- Specified by:
getAttributeCountin interfaceFeature- Returns:
- the attribute count.
-
equals
-
hashCode
public int hashCode()
-