@ParametersAreNonnullByDefault public abstract class AbstractFeatureBean extends Object implements FeatureBean
FeatureBean.| Modifier and Type | Field and Description |
|---|---|
protected int |
id
The identifier of the feature.
|
protected Id |
owner
The identifier of the object using the feature.
|
protected int |
position
The position of the feature in its
owner. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFeatureBean(Id owner,
int id)
Constructs a new
AbstractFeatureBean with the given owner and the given id. |
protected |
AbstractFeatureBean(Id owner,
int id,
int position)
Constructs a new
ManyFeatureBean with the given id and the given name, which are used as
a simple representation of a feature of an object. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(FeatureBean o) |
boolean |
equals(Object o) |
int |
hashCode() |
int |
id()
Returns the identifier of the feature.
|
Id |
owner()
Returns the identifier of the object using the feature.
|
int |
position()
Returns the position of the feature in the
FeatureBean.owner(). |
ManyFeatureBean |
withPosition(int position)
Creates a new
ManyFeatureBean with the Id and the name of this
FeatureBean, and adding the given position. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisManyprotected final int id
@Nonnegative protected final int position
owner.protected AbstractFeatureBean(Id owner, int id)
AbstractFeatureBean with the given owner and the given id.owner - the identifier of the object using the featureid - the identifier of the feature of the ownerNullPointerException - if any argument is nullprotected AbstractFeatureBean(Id owner, int id, int position)
ManyFeatureBean with the given id and the given name, which are used as
a simple representation of a feature of an object. The "multi-valued" characteristic is identified with the
position.owner - the identifier of the object using the featureid - the identifier of the feature of the ownerposition - the position of the featureNullPointerException - if any argument is nullIllegalArgumentException - if the position is negative when isMany() == true@Nonnull public Id owner()
FeatureBeanowner in interface FeatureBeanpublic int id()
FeatureBeanid in interface FeatureBean@Nonnegative public int position()
FeatureBeanFeatureBean.owner(). If isMany() == false, then returns -1.position in interface FeatureBean@Nonnull public ManyFeatureBean withPosition(@Nonnegative int position)
ManyFeatureBean with the Id and the name of this
FeatureBean, and adding the given position.position - the position of the featureManyFeatureBeanIllegalArgumentException - if the position is negativeManyFeatureBean.of(Id, int, int)public int compareTo(FeatureBean o)
compareTo in interface Comparable<FeatureBean>Copyright © 2013–2019 Atlanmod. All rights reserved.