org.dftproject.genesis.core.data.nodes
Class ResourceNode

java.lang.Object
  extended by org.dftproject.genesis.core.data.nodes.ResourceNode
All Implemented Interfaces:
INode, IResourceNode

public class ResourceNode
extends java.lang.Object
implements IResourceNode

A resource node.


Constructor Summary
ResourceNode(java.lang.String uri)
          Creates a resource node with the given name.
 
Method Summary
 void addObject(IResourceNode predicate, INode object, IResourceNode graph)
          Adds a statement wherein this node is the subject.
 boolean equals(java.lang.Object obj)
           
 INode getFirstObject(IResourceNode predicate)
          Returns the first object related to this node (as a subject) by the given predicate.
 Statement getFirstQuadAsSubject(IResourceNode predicate)
          Returns the first statement with the given predicate wherein this node is the subject.
 java.util.Map<IResourceNode,java.util.Set<Statement>> getQuadsAsSubject()
          Returns the mapping of predicate to statements wherein this node serves as the subject.
 java.util.Set<Statement> getQuadsAsSubject(IResourceNode predicate)
          Returns the statements with the given predicate wherein this node is the subject.
 org.apache.commons.collections.MultiMap getSubjects()
          Returns the subjects.
 java.lang.String getURI()
          Returns the name of this node.
 int hashCode()
           
 void removeObject(IResourceNode predicate, INode object, IResourceNode graph)
          Removes a statement wherein this node is the subject.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceNode

public ResourceNode(java.lang.String uri)
Creates a resource node with the given name.

Parameters:
uri - the name
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

addObject

public void addObject(IResourceNode predicate,
                      INode object,
                      IResourceNode graph)
Description copied from interface: IResourceNode
Adds a statement wherein this node is the subject.

Specified by:
addObject in interface IResourceNode
Parameters:
predicate - the predicate
object - the object
graph - the graph

getFirstObject

public INode getFirstObject(IResourceNode predicate)
Description copied from interface: IResourceNode
Returns the first object related to this node (as a subject) by the given predicate.

Specified by:
getFirstObject in interface IResourceNode
Parameters:
predicate - the predicate
Returns:
the object

getFirstQuadAsSubject

public Statement getFirstQuadAsSubject(IResourceNode predicate)
Description copied from interface: IResourceNode
Returns the first statement with the given predicate wherein this node is the subject.

Specified by:
getFirstQuadAsSubject in interface IResourceNode
Returns:
the statement

getQuadsAsSubject

public java.util.Map<IResourceNode,java.util.Set<Statement>> getQuadsAsSubject()
Description copied from interface: IResourceNode
Returns the mapping of predicate to statements wherein this node serves as the subject.

Specified by:
getQuadsAsSubject in interface IResourceNode
Returns:
the mapping

getQuadsAsSubject

public java.util.Set<Statement> getQuadsAsSubject(IResourceNode predicate)
Description copied from interface: IResourceNode
Returns the statements with the given predicate wherein this node is the subject.

Specified by:
getQuadsAsSubject in interface IResourceNode
Parameters:
predicate - the predicate
Returns:
the statements

getSubjects

public org.apache.commons.collections.MultiMap getSubjects()
Description copied from interface: IResourceNode
Returns the subjects.

Specified by:
getSubjects in interface IResourceNode
Returns:
the subjects

getURI

public java.lang.String getURI()
Description copied from interface: IResourceNode
Returns the name of this node.

Specified by:
getURI in interface IResourceNode
Returns:
the name of this node

removeObject

public void removeObject(IResourceNode predicate,
                         INode object,
                         IResourceNode graph)
Description copied from interface: IResourceNode
Removes a statement wherein this node is the subject.

Specified by:
removeObject in interface IResourceNode
Parameters:
predicate - the predicate
object - the object
graph - the graph

toString

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