T - the underlying data type of attributes having this propertypublic class PropertyImpl<T> extends DBObjectImpl implements Property<T>
Property.| Constructor and Description |
|---|
PropertyImpl(String name,
ValueType<T> valueType,
boolean indexed,
Surrogate surrogate)
Construct a
Property. |
| Modifier and Type | Method and Description |
|---|---|
void |
check(T value)
Check the value for conformity with the
ValueType. |
UpdatableProperty<T> |
edit()
Return an
UpdatableProperty corresponding to this property. |
List<Chronicle> |
getChronicles(T value,
int maxSize)
Return a list of chronicles which have the given attribute value.
|
String |
getName()
Return the name of the property.
|
ValueType<T> |
getValueType()
Return the value type of the property.
|
boolean |
isIndexed()
Return true if the property has been defined as indexed.
|
T |
scan(String value)
Return an object of the underlying data type for this property
converted from a textual value.
|
String |
toString() |
<S> Property<S> |
typeCheck(Class<S> type)
Cast the property to the type specified.
|
protected void |
update()
Refresh state.
|
equals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDatabase, getId, getSurrogate, inConstruction, isValidprotected void update()
public ValueType<T> getValueType()
PropertygetValueType in interface Property<T>public UpdatableProperty<T> edit()
PropertyUpdatableProperty corresponding to this property.
Successfully getting an Updatable object does not imply
that updates can be successfully applied.public boolean isIndexed()
Propertyindexed, it is meaningful to search for chronicles using
Property.getChronicles(Object, int). To give an example,
imagine a very large database where chronicles represent persons, with two attributes:
country of residence and email address. You would not search for persons residing in the
USA, would you? The size of the result would be enormous. On the other hand finding persons with a given email
address would be fast.public String getName()
Propertypublic T scan(String value) throws T2DBException
Propertyscan in interface Property<T>value - a textual representation of the valueT2DBExceptionpublic void check(T value) throws T2DBException
PropertyValueType.
An exception is thrown if the value does not conform.
A typical cause of failure is that the value is not in the list of values
allowed by a restricted value type.check in interface Property<T>value - a value to checkT2DBExceptionpublic List<Chronicle> getChronicles(T value, int maxSize) throws T2DBException
PropertygetChronicles in interface Property<T>value - the value to matchmaxSize - the maximum size of the result, 0 for no limitT2DBExceptionpublic <S> Property<S> typeCheck(Class<S> type) throws T2DBException
PropertytypeCheck in interface Property<T>type - the underlying type requiredT2DBExceptionCopyright © 2017. All rights reserved.