org.designwizard.design.relation
Class Relation

java.lang.Object
  extended by org.designwizard.design.relation.Relation

public class Relation
extends java.lang.Object

This class models a relation between two entities of the code.

Author:
João Arthur Brunet Monteiro - jarthur@dsc.ufcg.edu.br

Nested Class Summary
static class Relation.TypesOfRelation
          Types of relations
 
Constructor Summary
Relation(Entity caller, Entity called, Relation.TypesOfRelation type)
          Constructs a new ContainRealtion.
 
Method Summary
 boolean equals(java.lang.Object other)
          Method that verifies if a relation is equals another one.
 Entity getCalledEntity()
           
 Entity getCallerEntity()
           
 java.lang.String getName()
          Returns the name of this Relation.
 Relation.TypesOfRelation getType()
          Returns a string representing the type of this relation.
 int hashCode()
           
 boolean isEntity()
          Method that verifies if this element of design is an Entity or not.
 boolean isRelation()
          Method that verifies if this element of design is a Relation or not.
 java.lang.String toString()
          A String representation for the relation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Relation

public Relation(Entity caller,
                Entity called,
                Relation.TypesOfRelation type)
Constructs a new ContainRealtion.

Parameters:
caller - the caller entity of this relation (the entity that calls another entity.)
called - the called entity of this relation (the entity called by another one.)
Method Detail

getCallerEntity

public Entity getCallerEntity()

getCalledEntity

public Entity getCalledEntity()

toString

public java.lang.String toString()
A String representation for the relation. This string representation contains the two entities within this relation (separated by the type of this relation) and the status of this relation.

Overrides:
toString in class java.lang.Object

getType

public Relation.TypesOfRelation getType()
Returns a string representing the type of this relation.

Returns:
an string representing the type of the relation.

isEntity

public boolean isEntity()
Method that verifies if this element of design is an Entity or not.

Returns:
true if this element of design is an Entity or false if not.

isRelation

public boolean isRelation()
Method that verifies if this element of design is a Relation or not.

Returns:
true if this element of design is a Relation or false if not.

getName

public java.lang.String getName()
Returns the name of this Relation.

Returns:
the name of this Relation.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Method that verifies if a relation is equals another one.

Overrides:
equals in class java.lang.Object
Returns:
true if this relation is equals the another one or false if not.