|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.columbia.cs.ref.model.relationship.Relationship
public class Relationship
The Class Relationship represents relationships between several entities present
in a document.
A Relationship is defined by its type which is an instance of a RelationshipType.
Additionally, a relationship contains a set of entities that may be related or not.
Each of these entities fufills a role in the relationship.
Constructor Summary | |
---|---|
Relationship(RelationshipType type)
Instantiates a new relationship given a relationship type |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
Entity[] |
getEntities()
Gets an array containing the entities involved in the relationship |
java.lang.String |
getId()
Gets the id of the relationship. |
java.lang.String |
getLabel()
Gets the label. |
RelationshipType |
getRelationshipType()
Gets the relationship type. |
Entity |
getRole(java.lang.String role)
Gets the entity that fulfills a given role. |
java.util.Collection<java.lang.String> |
getRoles()
Gets the roles that are present in the relationship. |
int |
hashCode()
|
void |
setLabel(java.lang.String label)
Sets the label. |
void |
setRelationshipType(RelationshipType type)
Sets the relationship type. |
void |
setRole(java.lang.String role,
Entity e)
Indicates that a given entity is fulfilling a given role in the relationship. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Relationship(RelationshipType type)
type
- the type of relationship that this Relationship representsMethod Detail |
---|
public void setRelationshipType(RelationshipType type)
type
- the new relationship typepublic void setRole(java.lang.String role, Entity e)
role
- the role that the entity is fulfillinge
- the entity that is fulfilling the rolepublic Entity getRole(java.lang.String role)
role
- the desired role
public java.lang.String getId()
public Entity[] getEntities()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the new labelpublic RelationshipType getRelationshipType()
public java.util.Collection<java.lang.String> getRoles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |