|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.data.model.property.PropertyContainer
pl.edu.agh.cast.data.model.AbstractElement
pl.edu.agh.cast.data.model.general.Entity
public class Entity
Default implementation of IEntity
interface.
All public constructors set the element type to IEntity.TYPE
. Protected constructors should only be used by
direct subclasses to provide the concrete type to the super constructor.
IEntity
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from interface pl.edu.agh.cast.data.model.general.IEntity |
---|
IEntity.Properties |
Field Summary |
---|
Fields inherited from interface pl.edu.agh.cast.data.model.general.IEntity |
---|
TYPE |
Constructor Summary | |
---|---|
|
Entity()
Default constructor. |
|
Entity(IGeneralDataSet<? extends IGeneralElement> dataSet,
String name)
Creates a new entity with given data set, name and newly-generated ID. |
|
Entity(String name)
Creates a new entity with given name and newly-generated ID. |
protected |
Entity(Type type)
Initializes element with type. |
protected |
Entity(Type type,
UUID id,
String name)
Initializes element with type, ID and name. |
protected |
Entity(Type type,
UUID id,
String name,
List<IManyToManyRelation> incomingRelations,
List<IManyToManyRelation> outgoingRelations)
Initializes element with given type, ID, data set, name and incoming and outgoing relations. |
|
Entity(UUID id,
IGeneralDataSet<? extends IGeneralElement> dataSet,
String name)
Creates a new entity with given ID, data set and name. |
|
Entity(UUID id,
IGeneralDataSet<? extends IGeneralElement> dataSet,
String name,
List<IManyToManyRelation> incomingRelations,
List<IManyToManyRelation> outgoingRelations)
Creates a new entity with given ID, data set, name and incoming and outgoing relations. |
|
Entity(UUID id,
String name)
Creates a new entity with given ID and name. |
|
Entity(UUID id,
String name,
List<IManyToManyRelation> incomingRelations,
List<IManyToManyRelation> outgoingRelations)
Creates a new entity with given ID, data set, name and incoming and outgoing relations. |
Method Summary | |
---|---|
void |
addIncomingRelation(IManyToManyRelation relation)
Adds a new incoming relation to the entity, if not present. |
void |
addOutgoingRelation(IManyToManyRelation relation)
Adds a new outgoing relation to the entity, if not present. |
protected String |
getDescString()
Returns a string with short description of element. |
List<? extends IManyToManyRelation> |
getIncomingRelations()
Returns the list of incoming relations associated with the entity. |
String |
getName()
Returns the entity name. |
List<? extends IManyToManyRelation> |
getOutgoingRelations()
Returns the list of outgoing relations associated with the entity. |
boolean |
removeIncomingRelation(IManyToManyRelation relation)
Removes the specified incoming relation from the entity. |
boolean |
removeOutgoingRelation(IManyToManyRelation relation)
Removes the specified outgoing relation from the entity. |
Entity |
replicate()
Returns a replicated instance of this instance. |
Entity |
replicateTo(Object replica)
Replicates this instance state to given replica object. |
void |
setIncomingRelations(List<? extends IManyToManyRelation> relations)
Sets the list of incoming relations associated with the entity. |
void |
setName(String name)
Sets the entity name. |
void |
setOutgoingRelations(List<? extends IManyToManyRelation> relations)
Sets the list of outgoing relations associated with the entity. |
Methods inherited from class pl.edu.agh.cast.data.model.AbstractElement |
---|
afterSetMetaPropertyManager, canReplicateTo, checkIfValid, equals, getDataSet, getId, getType, hashCode, isValid, setDataSet, setId, setType, toString |
Methods inherited from class pl.edu.agh.cast.data.model.property.PropertyContainer |
---|
addProperty, createProperty, dispose, getCustomProperties, getMetaPropertyManager, getPermanentProperties, getProperties, getProperty, getTransientProperties, initializeProperties, matches, removeProperty, setMetaPropertyManager, setProperty, update |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface pl.edu.agh.cast.data.model.IElement |
---|
getDataSet |
Methods inherited from interface pl.edu.agh.cast.data.model.Identifiable |
---|
getId, getType |
Methods inherited from interface pl.edu.agh.cast.data.model.property.IPropertyContainer |
---|
addProperty, getCustomProperties, getMetaPropertyManager, getPermanentProperties, getProperties, getProperty, getTransientProperties, matches, removeProperty, setProperty |
Methods inherited from interface java.util.Observer |
---|
update |
Methods inherited from interface pl.edu.agh.cast.common.IValidatable |
---|
isValid |
Methods inherited from interface pl.edu.agh.cast.common.IDisposable |
---|
dispose |
Constructor Detail |
---|
public Entity()
Usage of this constructor is discouraged, since it does not provide any integrity control. If, however, this
constructor is used, the AbstractElement.isValid()
method should be called in order to check the integrity.
public Entity(String name)
name
- the name of the entity
IllegalArgumentException
public Entity(IGeneralDataSet<? extends IGeneralElement> dataSet, String name)
dataSet
- the data set this element is inname
- the name of the entity
IllegalArgumentException
public Entity(UUID id, String name)
id
- ID of the elementname
- the name of the entity
IllegalArgumentException
public Entity(UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet, String name)
id
- ID of the elementdataSet
- the data set this element is inname
- the name of the entity
IllegalArgumentException
public Entity(UUID id, String name, List<IManyToManyRelation> incomingRelations, List<IManyToManyRelation> outgoingRelations)
id
- ID of the elementname
- the name of the entityincomingRelations
- the list of references to incoming relations for this entity - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
outgoingRelations
- the list of references to outgoing relations for this entity - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
IllegalArgumentException
public Entity(UUID id, IGeneralDataSet<? extends IGeneralElement> dataSet, String name, List<IManyToManyRelation> incomingRelations, List<IManyToManyRelation> outgoingRelations)
id
- ID of the elementdataSet
- the data set this element is inname
- the name of the entityincomingRelations
- the list of references to incoming relations for this entity - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
outgoingRelations
- the list of references to outgoing relations for this entity - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
IllegalArgumentException
protected Entity(Type type)
This constructor should be used only by extending classes to implement the default constructor.
type
- type of the elementAbstractElement.AbstractElement(Type)
protected Entity(Type type, UUID id, String name)
type
- type of element which extends this oneid
- ID of the elementname
- the name of the entity
IllegalArgumentException
protected Entity(Type type, UUID id, String name, List<IManyToManyRelation> incomingRelations, List<IManyToManyRelation> outgoingRelations)
type
- type of element which extends this oneid
- ID of the elementdataSet
- the data set this element is inname
- the name of the entityincomingRelations
- the list of references to incoming relations for this entity - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
outgoingRelations
- the list of references to outgoing relations for this entity - if null
, then empty
IReferenceList
instance is acquired from ReferenceUtil
IllegalArgumentException
Method Detail |
---|
public final List<? extends IManyToManyRelation> getIncomingRelations()
getIncomingRelations
in interface IEntity
IEntity.getIncomingRelations()
public final void setIncomingRelations(List<? extends IManyToManyRelation> relations)
setIncomingRelations
in interface IEntity
relations
- list of incoming relations to setpl.edu.agh.cast.data.model.general.IEntity#setIncomingRelations(java.lang.Iterable)
public final void addIncomingRelation(IManyToManyRelation relation)
addIncomingRelation
in interface IEntity
relation
- incoming relation to be added#addIncomingRelation(pl.edu.agh.cast.data.model.general.IManyToManyRelation)
public final boolean removeIncomingRelation(IManyToManyRelation relation)
removeIncomingRelation
in interface IEntity
relation
- incoming relation to be removed, if present
true
if the relation was present and successfully removed#removeIncomingRelation(pl.edu.agh.cast.data.model.general.IManyToManyRelation)
public final List<? extends IManyToManyRelation> getOutgoingRelations()
getOutgoingRelations
in interface IEntity
IEntity.getOutgoingRelations()
public final void setOutgoingRelations(List<? extends IManyToManyRelation> relations)
setOutgoingRelations
in interface IEntity
relations
- list of outgoing relations to setpl.edu.agh.cast.data.model.general.IEntity#setOutgoingRelations(java.lang.Iterable)
public final void addOutgoingRelation(IManyToManyRelation relation)
addOutgoingRelation
in interface IEntity
relation
- outgoing relation to be added#addOutgoingRelation(pl.edu.agh.cast.data.model.general.IManyToManyRelation)
public final boolean removeOutgoingRelation(IManyToManyRelation relation)
removeOutgoingRelation
in interface IEntity
relation
- outgoing relation to be removed, if present
true
if the relation was present and successfully removed#removeOutgoingRelation(pl.edu.agh.cast.data.model.general.IManyToManyRelation)
public final String getName()
getName
in interface IEntity
IEntity.getName()
public final void setName(String name)
setName
in interface IEntity
name
- entity nameIEntity.setName(java.lang.String)
protected String getDescString()
AbstractElement.toString()
and may be
overridden in order to customize its results.
getDescString
in class AbstractElement
AbstractElement.getDescString()
public Entity replicateTo(Object replica) throws IllegalArgumentException, ReplicationException
Replicates element type and ID.
Replicates entity name, the lists of outgoing and incoming relations are empty.
replicateTo
in interface IReplicable
replicateTo
in class AbstractElement
replica
- the object to replicate to
IllegalArgumentException
- if given object is null or of invalid type
ReplicationException
- if replication failsAbstractElement.replicateTo(java.lang.Object)
public Entity replicate() throws ReplicationException
replicate
in interface IReplicable
replicate
in class AbstractElement
ReplicationException
- if replication failsIReplicable.replicate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |