java.lang.Objectucot.model.object.Entity
public class Entity
This class represents entity in analyze model.
Field Summary | |
---|---|
private java.util.Map<java.lang.String,Attribute> |
attributes
Maps attribute names and attributes. |
private java.util.Set<Entity> |
childEntities
The child entities. |
(package private) boolean |
deleted
Marks if this entity is deleted or not. |
private java.util.Map<java.lang.String,Method> |
methods
Maps method names and methods. |
private java.lang.String |
name
The name of this entity. |
private java.util.Set<Entity> |
parentEntities
The parent entities. |
static long |
serialVersionUID
|
private java.lang.String |
type
The type of the entity. |
Constructor Summary | |
---|---|
Entity(java.lang.String name)
Creates the entity. |
Method Summary | |
---|---|
void |
addAttribute(Attribute attribute)
Adds attribute. |
void |
addAttribute(java.lang.String name,
Attribute attribute)
Adds attribute for this entity |
void |
addChild(Entity entity)
Adds child for this Entity . |
void |
addMethod(Method method)
Adds method for this entity. |
void |
addMethod(java.lang.String methodName)
Creates and adds Method for this
Entity using given name. |
void |
addParent(Entity entity)
Adds parent for this Entity . |
private void |
checkEntityCollection(java.util.Collection<Entity> col)
Removes deleted entites from given collection. |
Attribute |
getAttribute(java.lang.String name)
Returns attribute called name. |
java.util.Set<Attribute> |
getAttributes()
Returns all the attributes. |
java.util.Set<Entity> |
getChildren()
Returns the children of this entity. |
Method |
getMethod(java.lang.String methodName)
Returns Method of this Entity
that is called 'name'. |
java.util.Set<java.lang.String> |
getMethodNames()
Returns the names of the methods. |
java.util.Set<Method> |
getMethods()
Get all the methods of this Entity . |
java.lang.String |
getName()
Returns the name of this entity. |
java.util.Set<Entity> |
getParents()
Returns the parent entities of this entity. |
java.lang.String |
getType()
Return the type of this entity. |
void |
removeAttribute(Attribute toBeRemoved)
Removes given attribute. |
void |
removeAttribute(java.lang.String name)
Removes attribute called name. |
void |
removeChild(Entity entity)
Removes child of this entity and also removes this entity from the parent list of a given entity if nessesary. |
void |
removeMethod(java.lang.String methodName)
Removes method called 'name'. |
void |
removeParent(Entity entity)
Removes parent of this entity and also removes this entity from the child list of a given entity if nessesary. |
protected void |
setName(java.lang.String name)
Sets the name of the entity. |
void |
setType(java.lang.String type)
Sets the type for this entity. |
private void |
updateAttributes()
Removes deleted entities from the attribute list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
private java.util.Map<java.lang.String,Attribute> attributes
private java.util.Map<java.lang.String,Method> methods
private java.util.Set<Entity> childEntities
private java.util.Set<Entity> parentEntities
private java.lang.String name
private java.lang.String type
boolean deleted
Constructor Detail |
---|
public Entity(java.lang.String name)
Creates the entity.
The name is modified so that the first letter is always an uppercase letter.
name
- Name of this entity.Method Detail |
---|
protected void setName(java.lang.String name)
Sets the name of the entity.
The name is modified so that the first letter is always an uppercase letter.
name
- Name of this entity.private void updateAttributes()
Removes deleted entities from the attribute list.
public void addAttribute(java.lang.String name, Attribute attribute)
Adds attribute for this entity
name
- Name of the Attribute
.attribute
- The Attribute
to add.public Attribute getAttribute(java.lang.String name)
Returns attribute called name.
name
- Name of the Attribute
to return.
Attribute
called 'name'.public java.util.Set<Attribute> getAttributes()
Returns all the attributes.
Attributes
of this
entity in a Set.public void removeAttribute(java.lang.String name)
Removes attribute called name.
name
- Name of the attribute to remove.public void removeAttribute(Attribute toBeRemoved)
Removes given attribute.
toBeRemoved
- Attribute
that should be removed.public void addAttribute(Attribute attribute)
Adds attribute.
Attributes name is set based on the name of the entity defined in attribute.
attribute
- Attribute
to add.public java.lang.String getName()
Returns the name of this entity.
private void checkEntityCollection(java.util.Collection<Entity> col)
col
- Collection of entities.public java.util.Set<Entity> getParents()
Returns the parent entities of this entity.
public java.util.Set<Entity> getChildren()
Returns the children of this entity.
public void addParent(Entity entity)
Adds parent for this Entity
. Also adds
this entity as a child of the given entity if nessesary.
entity
- Entity
that should be
added as parent.public void addChild(Entity entity)
Adds child for this Entity
. Also adds
this entity as a parent of the given entity if nessesary
entity
- Entity
that should be
added as child.public void removeParent(Entity entity)
Removes parent of this entity and also removes this entity from the child list of a given entity if nessesary.
entity
- Entity
that should be removed
from this entitys parents.public void removeChild(Entity entity)
Removes child of this entity and also removes this entity from the parent list of a given entity if nessesary.
entity
- Entity
that should be removed
from this entitys children.public Method getMethod(java.lang.String methodName)
Returns Method
of this Entity
that is called 'name'.
methodName
- Name of the Method
.
Method
called 'name'.public void addMethod(java.lang.String methodName)
Creates and adds Method
for this
Entity
using given name.
methodName
- Name of the Method
to add.public void addMethod(Method method)
Adds method for this entity.
method
- Method
to add.public void removeMethod(java.lang.String methodName)
Removes method called 'name'.
methodName
- Name of the method to remove.public java.util.Set<java.lang.String> getMethodNames()
Returns the names of the methods.
Entity
.public java.lang.String getType()
Return the type of this entity.
public void setType(java.lang.String type)
Sets the type for this entity.
type
- The typepublic java.util.Set<Method> getMethods()
Get all the methods of this Entity
.
Methods
of this Entity
.