Class BaseRelationshipDescription<P extends PropertiesDescription>
- java.lang.Object
-
- com.graphaware.common.description.BasePartiallyComparable<RelationshipDescription>
-
- com.graphaware.common.description.relationship.BaseRelationshipDescription<P>
-
- Type Parameters:
P
- type of properties description contained by this relationship description.
- All Implemented Interfaces:
MutuallyExclusive<RelationshipDescription>
,PartiallyComparable<RelationshipDescription>
,RelationshipDescription
- Direct Known Subclasses:
DetachedRelationshipDescriptionImpl
,LazyRelationshipDescription
public abstract class BaseRelationshipDescription<P extends PropertiesDescription> extends BasePartiallyComparable<RelationshipDescription> implements RelationshipDescription
Base class forRelationshipDescription
implementations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseRelationshipDescription(String relationshipType, Direction direction, P propertiesDescription)
Construct a new relationship description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Direction
getDirection()
Get the relationship direction.P
getPropertiesDescription()
Get the relationship's properties description.String
getType()
Get the relationship type.int
hashCode()
boolean
isMoreGeneralThan(RelationshipDescription other)
Is this instance more general than (or at least as general as) the given instance?boolean
isMutuallyExclusive(RelationshipDescription other)
Is this instance mutually exclusive with the given other instance? This method is reflexive.protected RelationshipDescription
self()
-
Methods inherited from class com.graphaware.common.description.BasePartiallyComparable
isMoreSpecificThan
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.graphaware.common.description.PartiallyComparable
isMoreSpecificThan
-
-
-
-
Constructor Detail
-
BaseRelationshipDescription
protected BaseRelationshipDescription(String relationshipType, Direction direction, P propertiesDescription)
Construct a new relationship description.- Parameters:
relationshipType
- relationship type.direction
- direction.propertiesDescription
- properties description.
-
-
Method Detail
-
isMoreGeneralThan
public boolean isMoreGeneralThan(RelationshipDescription other)
Description copied from interface:PartiallyComparable
Is this instance more general than (or at least as general as) the given instance?- Specified by:
isMoreGeneralThan
in interfacePartiallyComparable<P extends PropertiesDescription>
- Parameters:
other
- to compare.- Returns:
- true iff this instance is more general than or as general as the provided instance.
-
isMutuallyExclusive
public boolean isMutuallyExclusive(RelationshipDescription other)
Description copied from interface:MutuallyExclusive
Is this instance mutually exclusive with the given other instance? This method is reflexive.- Specified by:
isMutuallyExclusive
in interfaceMutuallyExclusive<P extends PropertiesDescription>
- Parameters:
other
- to check mutual exclusivity against.- Returns:
- true iff this and the other are mutually exclusive.
-
self
protected RelationshipDescription self()
- Specified by:
self
in classBasePartiallyComparable<RelationshipDescription>
- Returns:
- this.
-
getType
public String getType()
Description copied from interface:RelationshipDescription
Get the relationship type.- Specified by:
getType
in interfaceRelationshipDescription
- Returns:
- type.
-
getDirection
public Direction getDirection()
Description copied from interface:RelationshipDescription
Get the relationship direction.- Specified by:
getDirection
in interfaceRelationshipDescription
- Returns:
- direction. Note that this can be
Direction.BOTH
.
-
getPropertiesDescription
public P getPropertiesDescription()
Description copied from interface:RelationshipDescription
Get the relationship's properties description.- Specified by:
getPropertiesDescription
in interfaceRelationshipDescription
- Returns:
- properties description.
-
-