Package openllet.core.boxes.abox
Class EdgeList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Edge>
-
- openllet.core.boxes.abox.EdgeList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<Edge>
,java.util.Collection<Edge>
,java.util.List<Edge>
,java.util.RandomAccess
public class EdgeList extends java.util.ArrayList<Edge>
- Author:
- Evren Sirin
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addEdge(Edge e)
Deprecated.void
addEdgeList(EdgeList edges)
Deprecated.Edge
edgeAt(int i)
DependencySet
getDepends(boolean doExplanation)
EdgeList
getEdges(Role role)
EdgeList
getEdgesFrom(Individual from, Role r)
EdgeList
getEdgesTo(Node to)
EdgeList
getEdgesTo(Role r, Node to)
Edge
getExactEdge(Individual from, Role role, Node to)
java.util.Set<Node>
getFilteredNeighbors(Individual node, openllet.aterm.ATermAppl c)
Find the neighbors of a _node that has a certain type.java.util.Set<Node>
getNeighbors(Node node)
java.util.Set<Role>
getRoles()
boolean
hasEdge(Edge e)
boolean
hasEdge(Individual from, Role role, Node to)
Checks if this list contains an edge matching the given subject, predicate and object.boolean
hasEdge(Role role)
boolean
hasEdgeFrom(Individual from)
boolean
hasEdgeTo(Node to)
boolean
hasExactEdge(Individual from, Role role, Node to)
Similar tohasEdge(Individual, Role, Node)
but does not consider subproperty hierarchy for matching so only exact predicate matches are considered.boolean
removeEdge(Edge edge)
Remove an element by replacing it by the last element.void
reset()
Resets the edges in this list to only asserted edges.EdgeList
sort()
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
EdgeList
public EdgeList()
-
EdgeList
public EdgeList(int n)
-
EdgeList
public EdgeList(EdgeList edges)
-
-
Method Detail
-
addEdgeList
@Deprecated public void addEdgeList(EdgeList edges)
Deprecated.
-
addEdge
@Deprecated public void addEdge(Edge e)
Deprecated.
-
removeEdge
public boolean removeEdge(Edge edge)
Remove an element by replacing it by the last element. Order isn't preserved.- Parameters:
edge
- to remove- Returns:
- true if removing occured
-
edgeAt
public Edge edgeAt(int i)
-
sort
public EdgeList sort()
-
getEdgesFrom
public EdgeList getEdgesFrom(Individual from, Role r)
-
getRoles
public java.util.Set<Role> getRoles()
-
getFilteredNeighbors
public java.util.Set<Node> getFilteredNeighbors(Individual node, openllet.aterm.ATermAppl c)
Find the neighbors of a _node that has a certain type. For literals, we collect only the ones with the same language tag.- Parameters:
node
- The _node whose neighbors are being soughtc
- The concept (or datatype) that each _neighbor should belong to- Returns:
- Set of _nodes
-
hasEdgeFrom
public boolean hasEdgeFrom(Individual from)
-
hasEdgeTo
public boolean hasEdgeTo(Node to)
-
hasEdge
public boolean hasEdge(Role role)
-
hasEdge
public boolean hasEdge(Individual from, Role role, Node to)
Checks if this list contains an edge matching the given subject, predicate and object. A null parameter is treated as a wildcard matching every value and predicates are matched by considering the subproperty hierarchy, i.e. passing the parametersup
to this function will returntrue
if an edge with subpropertysub
exists.- Parameters:
from
-role
-to
-- Returns:
- true if contains an edge that match
-
hasExactEdge
public boolean hasExactEdge(Individual from, Role role, Node to)
Similar tohasEdge(Individual, Role, Node)
but does not consider subproperty hierarchy for matching so only exact predicate matches are considered.- Parameters:
from
-role
-to
-- Returns:
- true if contains an edge that match
-
hasEdge
public boolean hasEdge(Edge e)
-
getExactEdge
public Edge getExactEdge(Individual from, Role role, Node to)
-
getDepends
public DependencySet getDepends(boolean doExplanation)
-
reset
public void reset()
Resets the edges in this list to only asserted edges.
-
-