Package cdc.enums
Interface DynamicEnumSupport<V>
-
- Type Parameters:
V- The enum value type.
- All Known Subinterfaces:
AbstractForestDynamicEnum.Support<V>,AbstractListDynamicEnum.Support<V>
- All Known Implementing Classes:
AbstractDynamicEnumSupport
public interface DynamicEnumSupport<V> extends EnumType<V>
Base interface of services offered by dynamic enumerations.This adds modification (creation removal, ...) methods to EnumType.
- Author:
- Damien Carbonne
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VfindOrCreate(String qname)Returns the value corresponding to a name.voidlock()Definitely locks modifications.voidremove(V value)Removes a value.voidsetName(V value, String name)Changes a value name.-
Methods inherited from interface cdc.enums.DagType
getChildren, getParents, getRoots, isOverOrEqual, isRoot, isStrictlyOver, isStrictlyUnder, isUnderOrEqual
-
Methods inherited from interface cdc.enums.EnumType
getChildNamed, getName, getQName, hasChildNamed, hasSiblingNamed, hasValue, valueOf, valueOf
-
Methods inherited from interface cdc.enums.ListType
addEventHandler, areEqual, getValueClass, getValues, isLocked, isSupported, isUsable, isValid, removeEventHandler
-
-
-
-
Method Detail
-
lock
void lock()
Definitely locks modifications.
-
findOrCreate
V findOrCreate(String qname)
Returns the value corresponding to a name.If none exists, creates a new value and returns it.
- Parameters:
qname- The qualified name.- Returns:
- The value corresponding to
qname, possibly creating it. - Throws:
IllegalStateException- When locked and value corresponding toqnamedoes not exist.IllegalArgumentException- When locked and value corresponding toqnamedoes not exist andqnameis invalid.
-
remove
void remove(V value)
Removes a value.- Parameters:
value- The value to remove.- Throws:
IllegalStateException- When locked.UnsupportedOperationException- When removal is not supported.IllegalArgumentException- Whenvalueis invalid.
-
setName
void setName(V value, String name)
Changes a value name.- Parameters:
value- The value.name- The new local name.- Throws:
IllegalStateException- When locked.UnsupportedOperationException- When renaming is not supported.IllegalArgumentException- Whenvalueornameis invalid.
-
-