T
- the underlying data type of attributes having this propertypublic interface Property<T> extends DBObject
Attribute
. The value
of an attribute must agree with the property's ValueType
.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.
|
<S> Property<S> |
typeCheck(Class<S> type)
Cast the property to the type specified.
|
getDatabase, getId, getSurrogate, inConstruction, isValid
UpdatableProperty<T> edit()
UpdatableProperty
corresponding to this property.
Successfully getting an Updatable
object does not imply
that updates can be successfully applied.String getName()
boolean isIndexed()
indexed, it is meaningful to search for chronicles using
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.ValueType<T> getValueType()
void check(T value) throws T2DBException
ValueType
.
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.value
- a value to checkT2DBException
T scan(String value) throws T2DBException
value
- a textual representation of the valueT2DBException
List<Chronicle> getChronicles(T value, int maxSize) throws T2DBException
value
- the value to matchmaxSize
- the maximum size of the result, 0 for no limitT2DBException
<S> Property<S> typeCheck(Class<S> type) throws T2DBException
type
- the underlying type requiredT2DBException
Copyright © 2017. All rights reserved.