T
- the underlying data type of the attributepublic class AttributeDefinitionImpl<T> extends SchemaComponentImpl implements AttributeDefinition<T>
AttributeDefinition
.Constructor and Description |
---|
AttributeDefinitionImpl(int seriesNr,
int number,
Property<T> property,
T value)
Construct an attribute definition.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AttributeDefinition<T> o) |
SchemaComponent |
copy()
Return a copy.
|
void |
edit(SchemaComponent component)
Edit the component, taking the parameter as a template.
|
boolean |
equals(Object obj) |
Attribute<T> |
getAttribute()
Return the attribute.
|
String |
getName()
Return the name of the component.
|
int |
getNumber()
Return the number of the component.
|
Property<T> |
getProperty()
Return the attribute's property.
|
T |
getValue()
Return the attribute's default value.
|
int |
hashCode() |
boolean |
isComplete()
Return true if the component is complete and can be used.
|
boolean |
isErasing()
Return true if the definition removes an inherited definition.
|
void |
setErasing(boolean erasing)
Set the erasing mode of the definition.
|
void |
setProperty(Property<T> property)
Set the property.
|
void |
setValue(Object value)
Set the default value.
|
String |
toString() |
<S> AttributeDefinition<S> |
typeCheck(Class<S> type)
Cast the attribute definition to the type specified.
|
checkEdit, consolidate, edit, nameChanged, setContainer
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
consolidate, edit
public AttributeDefinitionImpl(int seriesNr, int number, Property<T> property, T value) throws T2DBException
seriesNr
- the series number or zero if a chronicle attributenumber
- the attribute numberproperty
- a propertyvalue
- a default value or nullT2DBException
public boolean isComplete()
SchemaComponent
Schema
defining an actual Chronicle
must
be complete. If the component is an AttributeDefinition
, it is
complete when the property of the attribute is defined and the default
value is valid. If the component is a SeriesDefinition
, it is
complete when the name, the type, and the time domain of the series are
defined, and all the series attributes are complete.isComplete
in interface SchemaComponent
public boolean isErasing()
SchemaComponent
UpdatableSchema.resolve()
.isErasing
in interface SchemaComponent
public int getNumber()
SchemaComponent
getNumber
in interface SchemaComponent
public Property<T> getProperty()
AttributeDefinition
getProperty
in interface AttributeDefinition<T>
public String getName()
SchemaComponent
getName
in interface SchemaComponent
public T getValue()
AttributeDefinition
getValue
in interface AttributeDefinition<T>
public Attribute<T> getAttribute()
AttributeDefinition
isComplete()
returns false throws an IllegalStateException
getAttribute
in interface AttributeDefinition<T>
public int compareTo(AttributeDefinition<T> o)
compareTo
in interface Comparable<AttributeDefinition<T>>
public void setErasing(boolean erasing)
erasing
- if true the definition removes an inherited definitionpublic void setProperty(Property<T> property) throws T2DBException
property
- a property or nullT2DBException
public void setValue(Object value) throws T2DBException
value
- a value or nullT2DBException
public void edit(SchemaComponent component)
SchemaComponent
edit
in interface SchemaComponent
component
- a component serving as templatepublic SchemaComponent copy()
SchemaComponent
copy
in interface SchemaComponent
public <S> AttributeDefinition<S> typeCheck(Class<S> type) throws T2DBException
AttributeDefinition
typeCheck
in interface AttributeDefinition<T>
type
- the underlying type requiredT2DBException
Copyright © 2017. All rights reserved.