T - the underlying data type of the valuespublic class UpdatableValueTypeImpl<T> extends ValueTypeImpl<T> implements UpdatableValueType<T>
UpdatableValueType.ValueTypeImpl.BooleanScanner, ValueTypeImpl.DateScanner, ValueTypeImpl.DateTimeScanner, ValueTypeImpl.NameScanner, ValueTypeImpl.NumberScanner, ValueTypeImpl.TextScanner, ValueTypeImpl.TimeDomainScanner, ValueTypeImpl.TypeScannerValueType.StandardValueType| Modifier | Constructor and Description |
|---|---|
|
UpdatableValueTypeImpl(String name,
boolean restricted,
String scannerClassOrKeyword,
Map<String,String> valuesAndDescriptions,
Surrogate surrogate)
Construct an
UpdatableValueType. |
protected |
UpdatableValueTypeImpl(ValueTypeImpl<T> valueType)
Construct an
UpdatableValueType. |
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(T value,
String description)
Add a value to list of allowed values.
|
void |
applyUpdates()
Apply pending updates.
|
void |
deleteValue(T value)
Delete a value from the list of allowed values.
|
void |
destroy()
Destroy the value type.
|
UpdatableValueType<T> |
edit()
Return an
UpdatableValueType corresponding to this value type. |
String |
getName()
Return the name of the value type.
|
Map<T,String> |
getValueDescriptions()
Return a map with allowed values as keys and a description for each
value.
|
Set<T> |
getValues()
Return the set of allowed values.
|
void |
setName(String name)
Set the name of the value type.
|
protected void |
update()
Refresh state.
|
void |
updateValue(T value,
String description)
Update the description of the given allowed value.
|
check, getAccessMethods, getExternalRepresentation, getScanner, getStandardValueType, getType, getValues, isBuiltIn, isCompatible, isRestricted, scan, toString, toString, typeCheckequals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValidclone, finalize, getClass, notify, notifyAll, wait, wait, waitcheck, getExternalRepresentation, getScanner, getStandardValueType, getType, getValues, isBuiltIn, isCompatible, isRestricted, scan, toString, typeCheckgetDatabase, getId, getSurrogate, inConstruction, isValidprotected UpdatableValueTypeImpl(ValueTypeImpl<T> valueType) throws T2DBException
UpdatableValueType.
This constructor is meant for ValueTypeImpl.edit().valueType - a value typeT2DBExceptionpublic UpdatableValueTypeImpl(String name, boolean restricted, String scannerClassOrKeyword, Map<String,String> valuesAndDescriptions, Surrogate surrogate) throws T2DBException
UpdatableValueType.name - a stringrestricted - if true the value type will keep a list of allowed valuesscannerClassOrKeyword - a keyword identifying a standard value type of the name of a scanner classvaluesAndDescriptions - a map of allowed values (as strings) and their descriptionsurrogate - a surrogateT2DBExceptionprotected void update()
throws T2DBException
ValueTypeImplupdate in class ValueTypeImpl<T>T2DBExceptionpublic void applyUpdates()
throws T2DBException
UpdatableDatabase.commit() and
Database.rollback() is the client's responsibility.applyUpdates in interface UpdatableT2DBExceptionpublic UpdatableValueType<T> edit()
ValueTypeUpdatableValueType corresponding to this value type.
Successfully getting an Updatable object does not imply
that updates can be successfully applied.public String getName()
ValueTypepublic void setName(String name) throws T2DBException
UpdatableValueTypesetName in interface UpdatableValueType<T>name - a stringT2DBExceptionpublic Set<T> getValues()
ValueTypepublic Map<T,String> getValueDescriptions()
ValueTypegetValueDescriptions in interface ValueType<T>getValueDescriptions in class ValueTypeImpl<T>public void addValue(T value, String description) throws T2DBException
UpdatableValueTypeaddValue in interface UpdatableValueType<T>value - a valuedescription - the value's descriptionT2DBExceptionpublic void updateValue(T value, String description) throws T2DBException
UpdatableValueTypeupdateValue in interface UpdatableValueType<T>value - an allowed valuedescription - a stringT2DBExceptionpublic void deleteValue(T value) throws T2DBException
UpdatableValueTypedeleteValue in interface UpdatableValueType<T>value - the value to deleteT2DBExceptionpublic void destroy()
throws T2DBException
UpdatableValueTypedestroy in interface UpdatableValueType<T>T2DBExceptionCopyright © 2017. All rights reserved.