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 void
addElement(int i, FeatureElement element)
Adds a feature element at the ith position of the feature.void
addElements(FeatureElement[] newElements)
Appends a list of elements to the end of the feature.java.lang.Object
clone()
Support cloneablevoid
deleteElement(int i)
Deletes the ith element in the feature.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.int
findElement(FeatureElement element)
Finds the input feature element in this feature, and returns the feature element index.CategorizedUserData
getCategorizedUserData()
Returns categorized user data.CategorizedUserData
getCategorizedUserData()
FeatureElement
getElement(int i)
Returns the ith element in the feature.FeatureElement[]
getElements()
Returns the feature elements in the feature.long
getId()
Returns the feature ID.int
getNumberOfElements()
Returns the number of elements in the feature.Feature.FeatureType
getType()
Returns the feature type.UserData
getUserData(int category)
Returns user data for the specified category.UserData
getUserData(int category)
void
setCategorizedUserData(CategorizedUserData userData)
Sets categorized user data.void
setCategorizedUserData(CategorizedUserData cud)
void
setElement(int i, FeatureElement element)
Sets the ith feature element.void
setUserData(int category, UserData userData)
Sets user data for the specified category.void
setUserData(int category, UserData userData)
java.lang.String
toString()
-
-
-
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:Feature
Returns the feature ID.
-
getType
public Feature.FeatureType getType()
Description copied from interface:Feature
Returns the feature type.
-
getElement
public FeatureElement getElement(int i)
Description copied from interface:Feature
Returns the ith element in the feature.- Specified by:
getElement
in interfaceFeature
- Parameters:
i
- feature element index- Returns:
-
getElements
public FeatureElement[] getElements()
Description copied from interface:Feature
Returns the feature elements in the feature.- Specified by:
getElements
in interfaceFeature
- Returns:
-
getNumberOfElements
public int getNumberOfElements()
Description copied from interface:Feature
Returns the number of elements in the feature.- Specified by:
getNumberOfElements
in interfaceFeature
- Returns:
-
addElement
public void addElement(int i, FeatureElement element)
Description copied from interface:Feature
Adds a feature element at the ith position of the feature.- Specified by:
addElement
in interfaceFeature
- Parameters:
i
- feature element index
-
addElements
public void addElements(FeatureElement[] newElements)
Description copied from interface:Feature
Appends a list of elements to the end of the feature.- Specified by:
addElements
in interfaceFeature
-
deleteElement
public void deleteElement(int i)
Description copied from interface:Feature
Deletes the ith element in the feature.- Specified by:
deleteElement
in interfaceFeature
- Parameters:
i
- feature element index
-
findElement
public int findElement(FeatureElement element)
Description copied from interface:Feature
Finds the input feature element in this feature, and returns the feature element index. If the feature element is not found, returns 0.- Specified by:
findElement
in interfaceFeature
- Returns:
-
setElement
public void setElement(int i, FeatureElement element)
Description copied from interface:Feature
Sets the ith feature element.- Specified by:
setElement
in interfaceFeature
- Parameters:
i
- feature element index
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Support 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:
equals
in classjava.lang.Object
- Parameters:
o
-- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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)
-
-