ObjectType
- The type of the objects that the relations are between.
This is also the type of the nodes in the network.RelationType
- The type of the relations between objects in the
network. This is also the type of the edges in the network.public interface RelationNetwork<ObjectType,RelationType>
Modifier and Type | Method and Description |
---|---|
java.util.Set<RelationType> |
getAllRelations(ObjectType source,
ObjectType target)
Gets all the relation between the source and the target.
|
int |
getObjectCount()
Gets the number of objects that the relations are between.
|
java.util.Set<ObjectType> |
getObjects()
Gets the set of objects that make up the nodes in the network.
|
RelationType |
getRelation(ObjectType source,
ObjectType target)
Gets a relation between the source and the target.
|
ObjectType |
getRelationSource(RelationType relation)
Gets the source of a given relation.
|
ObjectType |
getRelationTarget(RelationType relation)
Gets the target of a given relation.
|
boolean |
hasRelation(ObjectType source,
ObjectType target)
Determines if the network has a relation between the two given objects.
|
boolean |
isObject(java.lang.Object o)
Determines whether or not the given object is a node in the relation
network.
|
java.util.Set<RelationType> |
relationsFrom(ObjectType source)
Gets all of the relations where the given object is the source.
|
java.util.Set<RelationType> |
relationsOf(ObjectType o)
Gets all of the relations that involve the given object.
|
java.util.Set<RelationType> |
relationsTo(ObjectType target)
Gets all of the relations where the given object is the target.
|
int getObjectCount()
java.util.Set<ObjectType> getObjects()
boolean isObject(java.lang.Object o)
o
- An object.boolean hasRelation(ObjectType source, ObjectType target)
source
- The source object.target
- The target object.RelationType getRelation(ObjectType source, ObjectType target)
source
- The source object.target
- The target object.java.util.Set<RelationType> getAllRelations(ObjectType source, ObjectType target)
source
- The source object.target
- The target object.ObjectType getRelationSource(RelationType relation)
relation
- A relation from the network.ObjectType getRelationTarget(RelationType relation)
relation
- A relation from the network.java.util.Set<RelationType> relationsOf(ObjectType o)
o
- An object (node) from the network.java.util.Set<RelationType> relationsFrom(ObjectType source)
source
- An object (node) from the network.java.util.Set<RelationType> relationsTo(ObjectType target)
target
- An object (node) from the network.