public abstract class Feature
extends java.lang.Object
FeatureValues and along with its ClassAttributeAssignmentModel if any.
This class is the service representation of Feature.| Modifier and Type | Field and Description |
|---|---|
protected ClassAttributeAssignmentModel |
assignment |
protected java.lang.String |
code |
protected java.lang.String |
name |
| Constructor and Description |
|---|
Feature(ClassAttributeAssignmentModel assignment) |
Feature(java.lang.String code) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addValue(FeatureValue fvalue)
Add to this feature a
FeatureValue |
abstract void |
addValue(int index,
FeatureValue fvalue)
Inserts the
FeatureValueat the specified index position in this list (optional operation). |
ClassAttributeAssignmentModel |
getClassAttributeAssignment()
Returns the classification attribute assignment or null if untyped feature.
|
java.lang.String |
getCode()
Gets the code of the feature computed from assignment for typed feature or direct code for untyped feature.
|
java.lang.String |
getName()
Returns name of the feature.
|
abstract FeatureValue |
getValue()
Convenience method to return a single value.
|
abstract java.util.List<FeatureValue> |
getValues()
Returns the list of feature values.
|
abstract void |
removeAllValues()
Remove all containing
FeatureValues from the current feature. |
abstract boolean |
removeValue(FeatureValue fvalue)
Removes the first occurrence of the given
FeatureValue from the feature, if it is present (optional
operation). |
abstract void |
setValues(java.util.List<FeatureValue> fvalues)
Clears always all
FeatureValue of this Feature and add the given List with FeatureValues to this Feature. |
java.lang.String |
toString()
Returns a human readable description.
|
protected java.lang.String code
protected java.lang.String name
protected final ClassAttributeAssignmentModel assignment
public Feature(java.lang.String code)
public Feature(ClassAttributeAssignmentModel assignment)
public java.lang.String getCode()
ClassificationUtils.createFeatureQualifier(ClassAttributeAssignmentModel)public abstract java.util.List<FeatureValue> getValues()
public abstract FeatureValue getValue()
public abstract void addValue(FeatureValue fvalue)
FeatureValuefvalue - the feature valuepublic abstract void addValue(int index,
FeatureValue fvalue)
FeatureValueat the specified index position in this list (optional operation). Shifts the
element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).index - the index valuefvalue - the feature valuepublic abstract boolean removeValue(FeatureValue fvalue)
FeatureValue from the feature, if it is present (optional
operation). If this UnlocalizedFeature does not contain this FeatureValue, it is unchanged. More
formally, removes the element with the lowest index i such that
(o==null ? get(i)==null : o.equals(get(i))) (if such an element exists). Returns
true if the feature contained the specified feature value.fvalue - the FeatureValue to be removedpublic abstract void removeAllValues()
FeatureValues from the current feature.public abstract void setValues(java.util.List<FeatureValue> fvalues)
FeatureValue of this Feature and add the given List with FeatureValues to this Feature.
If the parameter is null the internal FeatureValue List will only be cleared (same behaviour as
removeAllValues()fvalues - the list with feature values or nullpublic java.lang.String toString()
toString in class java.lang.Objectpublic ClassAttributeAssignmentModel getClassAttributeAssignment()
public java.lang.String getName()
ClassAttributeAssignmentModel the code is returned
instead.Copyright © 2018 SAP SE. All Rights Reserved.