Package oracle.spatial.network.lod
Class FeatureImpl
- java.lang.Object
-
- oracle.spatial.network.lod.FeatureImpl
-
- All Implemented Interfaces:
Feature
- Direct Known Subclasses:
PathFeatureImpl
public class FeatureImpl extends java.lang.Object implements Feature
Default implementation of Feature.- Since:
- 12.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oracle.spatial.network.lod.Feature
Feature.FeatureType
-
-
Constructor Summary
Constructors Constructor Description FeatureImpl(long id, FeatureElement[] elements, CategorizedUserData cud)Constructs a feature.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddElement(int i, FeatureElement element)Adds a feature element at the ith position of the feature.voidaddElements(FeatureElement[] newElements)Appends a list of elements to the end of the feature.java.lang.Objectclone()Support cloneablevoiddeleteElement(int i)Deletes the ith element in the feature.booleanequals(java.lang.Object o)Returns true if the input feature consists of the same set of feature elements in the same order as this feature.intfindElement(FeatureElement element)Finds the input feature element in this feature, and returns the feature element index.CategorizedUserDatagetCategorizedUserData()Returns categorized user data.CategorizedUserDatagetCategorizedUserData()FeatureElementgetElement(int i)Returns the ith element in the feature.FeatureElement[]getElements()Returns the feature elements in the feature.longgetId()Returns the feature ID.intgetNumberOfElements()Returns the number of elements in the feature.Feature.FeatureTypegetType()Returns the feature type.UserDatagetUserData(int category)Returns user data for the specified category.UserDatagetUserData(int category)voidsetCategorizedUserData(CategorizedUserData userData)Sets categorized user data.voidsetCategorizedUserData(CategorizedUserData cud)voidsetElement(int i, FeatureElement element)Sets the ith feature element.voidsetUserData(int category, UserData userData)Sets user data for the specified category.voidsetUserData(int category, UserData userData)java.lang.StringtoString()
-
-
-
Constructor Detail
-
FeatureImpl
public FeatureImpl(long id, FeatureElement[] elements, CategorizedUserData cud)Constructs a feature.- Parameters:
id- feature IDtype- feature typeelements- feature elementscud- categorized user data associated with the feature
-
-
Method Detail
-
getId
public long getId()
Description copied from interface:FeatureReturns the feature ID.
-
getType
public Feature.FeatureType getType()
Description copied from interface:FeatureReturns the feature type.
-
getElement
public FeatureElement getElement(int i)
Description copied from interface:FeatureReturns the ith element in the feature.- Specified by:
getElementin interfaceFeature- Parameters:
i- feature element index- Returns:
-
getElements
public FeatureElement[] getElements()
Description copied from interface:FeatureReturns the feature elements in the feature.- Specified by:
getElementsin interfaceFeature- Returns:
-
getNumberOfElements
public int getNumberOfElements()
Description copied from interface:FeatureReturns the number of elements in the feature.- Specified by:
getNumberOfElementsin interfaceFeature- Returns:
-
addElement
public void addElement(int i, FeatureElement element)Description copied from interface:FeatureAdds a feature element at the ith position of the feature.- Specified by:
addElementin interfaceFeature- Parameters:
i- feature element index
-
addElements
public void addElements(FeatureElement[] newElements)
Description copied from interface:FeatureAppends a list of elements to the end of the feature.- Specified by:
addElementsin interfaceFeature
-
deleteElement
public void deleteElement(int i)
Description copied from interface:FeatureDeletes the ith element in the feature.- Specified by:
deleteElementin interfaceFeature- Parameters:
i- feature element index
-
findElement
public int findElement(FeatureElement element)
Description copied from interface:FeatureFinds the input feature element in this feature, and returns the feature element index. If the feature element is not found, returns 0.- Specified by:
findElementin interfaceFeature- Returns:
-
setElement
public void setElement(int i, FeatureElement element)Description copied from interface:FeatureSets the ith feature element.- Specified by:
setElementin interfaceFeature- Parameters:
i- feature element index
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionSupport cloneable- Returns:
- cloned object
- Throws:
java.lang.CloneNotSupportedException
-
equals
public boolean equals(java.lang.Object o)
Returns true if the input feature consists of the same set of feature elements in the same order as this feature. When comparing two features, we assume the order of the feature elements matters. This method returns false if the input feature contains the same set of feature elements but in different order.- Overrides:
equalsin classjava.lang.Object- Parameters:
o-- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCategorizedUserData
public abstract CategorizedUserData getCategorizedUserData()
Returns categorized user data.- Returns:
-
setCategorizedUserData
public abstract void setCategorizedUserData(CategorizedUserData userData)
Sets categorized user data.- Parameters:
userData-
-
getUserData
public abstract UserData getUserData(int category)
Returns user data for the specified category.- Returns:
-
setUserData
public abstract void setUserData(int category, UserData userData)Sets user data for the specified category.- Parameters:
userData-
-
getCategorizedUserData
public CategorizedUserData getCategorizedUserData()
-
setCategorizedUserData
public void setCategorizedUserData(CategorizedUserData cud)
-
getUserData
public UserData getUserData(int category)
-
setUserData
public void setUserData(int category, UserData userData)
-
-