|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.columbia.cs.ref.model.relationship.RelationshipType
public class RelationshipType
The Class RelationshipType represents a type of relationship that we are interested
in.
The RelationshipType contains more than the label indicating the semantics of the
relationship. Namely, a relationship type may also contain some constraints imposed
over roles, the relationship itself and the entities that can be matched. These
constraints are used to check if, given a RelationshipType, a given relationship is
valid.
Field Summary | |
---|---|
static java.lang.String |
NOT_A_RELATIONSHIP
The Constant NOT_A_RELATIONSHIP. |
Constructor Summary | |
---|---|
RelationshipType(java.lang.String type,
java.lang.String... roles)
Instantiates a new relationship type. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
RoleConstraint |
getConstraint(java.lang.String role)
Gets the constraint imposed over some role |
int |
getIndex(java.lang.String role)
Gets the index of the role in a vector representation of a relationship. |
EntityMatcher |
getMatchers(java.lang.String role)
Gets the entity matcher for a given role |
int |
getNumberEntities()
Gets the number of entities involved in this relationship type. |
RelationshipConstraint |
getRelationshipConstraint()
Gets the relationship constraint for this relationship type. |
java.util.Set<java.lang.String> |
getRoles()
Gets the roles used in this relationship type. |
java.lang.String |
getType()
Gets the label of the relationships. |
int |
hashCode()
|
boolean |
isType(java.lang.String relType)
Checks if the type of relationship is the same as a given string. |
void |
setConstraints(RelationshipConstraint constraint)
Sets the relationship constraint for this relationship type. |
void |
setConstraints(RoleConstraint constraint,
java.lang.String role)
Sets the constraint imposed over some role |
void |
setMatchers(EntityMatcher matcher,
java.lang.String role)
Sets the entity matcher for a given role |
void |
setType(java.lang.String type)
Sets the label of the relationships. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NOT_A_RELATIONSHIP
Constructor Detail |
---|
public RelationshipType(java.lang.String type, java.lang.String... roles)
type
- the typeroles
- the rolesMethod Detail |
---|
public int getIndex(java.lang.String role)
role
- the role for which we want to check the index
public void setType(java.lang.String type)
type
- the new label of the relationshipspublic java.lang.String getType()
public int getNumberEntities()
public java.util.Set<java.lang.String> getRoles()
public boolean isType(java.lang.String relType)
relType
- the relationship type label
public void setConstraints(RoleConstraint constraint, java.lang.String role)
constraint
- the constraintrole
- the rolepublic RoleConstraint getConstraint(java.lang.String role)
role
- the role
public void setMatchers(EntityMatcher matcher, java.lang.String role)
matcher
- the matcherrole
- the rolepublic EntityMatcher getMatchers(java.lang.String role)
role
- the role
public void setConstraints(RelationshipConstraint constraint)
constraint
- the new constraintspublic RelationshipConstraint getRelationshipConstraint()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |