Package cdc.enums
Interface ListType<V>
-
- Type Parameters:
V- The value type.
- All Known Subinterfaces:
AbstractForestDynamicEnum.Support<V>,AbstractListDynamicEnum.Support<V>,DagType<V>,DynamicEnumSupport<V>,EnumType<V>
- All Known Implementing Classes:
AbstractBaseDagSupport,AbstractBaseListSupport,AbstractDynamicEnumSupport,BooleanEnumType
public interface ListType<V>Interface describing a List type.- Author:
- Damien Carbonne
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddEventHandler(DagEventHandler handler)Adds an event handler.booleanareEqual(V left, V right)Returnstrueif 2 values are equal.Class<V>getValueClass()List<V>getValues()booleanisLocked()Returnstruewhen modifications are disabled.booleanisSupported(DagFeature feature)Returnstruewhen a feature is supported.default booleanisUsable(DagFeature feature)Returnstruewhen a feature can be used.booleanisValid(V value)Returnstruewhen a value is valid.voidremoveEventHandler(DagEventHandler handler)Removes an event handler.
-
-
-
Method Detail
-
addEventHandler
void addEventHandler(DagEventHandler handler)
Adds an event handler.- Parameters:
handler- The event handler.
-
removeEventHandler
void removeEventHandler(DagEventHandler handler)
Removes an event handler.- Parameters:
handler- The event handler.
-
isSupported
boolean isSupported(DagFeature feature)
Returnstruewhen a feature is supported.Locking may make a feature not available even if it is supported.
- Parameters:
feature- The feature.- Returns:
truewhenfeatureis supported.
-
isUsable
default boolean isUsable(DagFeature feature)
Returnstruewhen a feature can be used.It must be supported and the type must not be locked.
- Parameters:
feature- the feature.- Returns:
truewhenfeaturecan be used.
-
isLocked
boolean isLocked()
Returnstruewhen modifications are disabled.A static implementation is always locked.
After locking a dynamic implementation, it is impossible to unlock it.- Returns:
truewhen modifications (creation, removal, ...) are disabled.
-
isValid
boolean isValid(V value)
Returnstruewhen a value is valid.Depending on the enum implementation, a value may be valid at a time and invalid at another time.
Standard enums values are always valid.
Anullvalue is invalid.- Parameters:
value- The value.- Returns:
trueifvalueis valid.
-
-