org.mindswap.pellet
Class EdgeList

java.lang.Object
  extended by org.mindswap.pellet.EdgeList
All Implemented Interfaces:
java.lang.Iterable<Edge>

public class EdgeList
extends java.lang.Object
implements java.lang.Iterable<Edge>

Author:
Evren Sirin

Constructor Summary
EdgeList()
           
EdgeList(Edge edge)
          Create an immutable singleton EdgeList;
EdgeList(EdgeList edges)
           
EdgeList(int n)
           
 
Method Summary
 void addEdge(Edge e)
           
 void addEdgeList(EdgeList edges)
           
 Edge edgeAt(int i)
           
 DependencySet getDepends(boolean doExplanation)
           
 EdgeList getEdges(Role role)
           
 EdgeList getEdgesFrom(Individual from)
           
 EdgeList getEdgesFrom(Individual from, Role r)
           
 EdgeList getEdgesFromTo(Individual from, Node to)
           
 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, 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 hasEdgeFrom(Individual from, Role role)
           
 boolean hasEdgeTo(Node to)
           
 boolean hasEdgeTo(Role role, Node to)
           
 boolean hasExactEdge(Individual from, Role role, Node to)
          Similar to hasEdge(Individual, Role, Node) but does not consider subproperty hierarchy for matching so only exact predicate matches are considered.
 boolean isEmpty()
           
 java.util.Iterator<Edge> iterator()
           
 boolean removeEdge(Edge edge)
           
 void reset()
          Resets the edges in this list to only asserted edges.
 int size()
           
 EdgeList sort()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EdgeList

public EdgeList()

EdgeList

public EdgeList(int n)

EdgeList

public EdgeList(EdgeList edges)

EdgeList

public EdgeList(Edge edge)
Create an immutable singleton EdgeList;

Parameters:
edge -
Method Detail

addEdgeList

public void addEdgeList(EdgeList edges)

addEdge

public void addEdge(Edge e)

removeEdge

public boolean removeEdge(Edge edge)

edgeAt

public Edge edgeAt(int i)

size

public int size()

sort

public EdgeList sort()

isEmpty

public boolean isEmpty()

iterator

public java.util.Iterator<Edge> iterator()
Specified by:
iterator in interface java.lang.Iterable<Edge>

getEdgesFromTo

public EdgeList getEdgesFromTo(Individual from,
                               Node to)

getEdgesFrom

public EdgeList getEdgesFrom(Individual from)

getEdgesTo

public EdgeList getEdgesTo(Node to)

getEdgesTo

public EdgeList getEdgesTo(Role r,
                           Node to)

getEdgesFrom

public EdgeList getEdgesFrom(Individual from,
                             Role r)

getEdges

public EdgeList getEdges(Role role)

getRoles

public java.util.Set<Role> getRoles()

getNeighbors

public java.util.Set<Node> getNeighbors(Node node)

getFilteredNeighbors

public java.util.Set<Node> getFilteredNeighbors(Individual node,
                                                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 sought
c - The concept (or datatype) that each neighbor should belong to
Returns:
Set of nodes

hasEdgeFrom

public boolean hasEdgeFrom(Individual from)

hasEdgeFrom

public boolean hasEdgeFrom(Individual from,
                           Role role)

hasEdgeTo

public boolean hasEdgeTo(Node to)

hasEdgeTo

public boolean hasEdgeTo(Role role,
                         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 parameter sup to this function will return true if an edge with subproperty sub exists.

Parameters:
from -
role -
to -
Returns:

hasExactEdge

public boolean hasExactEdge(Individual from,
                            Role role,
                            Node to)
Similar to hasEdge(Individual, Role, Node) but does not consider subproperty hierarchy for matching so only exact predicate matches are considered.

Parameters:
from -
role -
to -
Returns:

hasEdge

public boolean hasEdge(Edge e)

getExactEdge

public Edge getExactEdge(Individual from,
                         Role role,
                         Node to)

getDepends

public DependencySet getDepends(boolean doExplanation)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

reset

public void reset()
Resets the edges in this list to only asserted edges.



Copyright © 2004 Evren Sirin. All Rights Reserved.