org.openrdf.model.impl
Class StatementImpl

java.lang.Object
  extended byorg.openrdf.model.impl.StatementImpl
All Implemented Interfaces:
Comparable, Serializable, Statement

public class StatementImpl
extends Object
implements Statement, Serializable

An implementation of the Statement interface.

See Also:
Serialized Form

Constructor Summary
StatementImpl(Resource subject, URI predicate, Value object)
          Creates a new Statement with the supplied subject, predicate and object.
 
Method Summary
 int compareTo(Object o)
          Compares this Statement with the supplied object.
 boolean equals(Object other)
          Compares a statement object to another object.
 Value getObject()
          Gets the object of this statement.
 URI getPredicate()
          Gets the predicate of this statement.
 Resource getSubject()
          Gets the subject of this statement.
 int hashCode()
          The hash code of a statement is defined as follows: (0xFF0000 & subject.hashCode()) | (0x00FF00 & predicate.hashCode()) | (0x0000FF & object.hashCode());
 String toString()
          Gives a String-representation of this Statement that can be used for debugging.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatementImpl

public StatementImpl(Resource subject,
                     URI predicate,
                     Value object)
Creates a new Statement with the supplied subject, predicate and object.

Parameters:
subject - The statement's subject.
predicate - The statement's predicate.
object - The statement's object.
Method Detail

getSubject

public Resource getSubject()
Description copied from interface: Statement
Gets the subject of this statement.

Specified by:
getSubject in interface Statement
Returns:
The statement's subject.

getPredicate

public URI getPredicate()
Description copied from interface: Statement
Gets the predicate of this statement.

Specified by:
getPredicate in interface Statement
Returns:
The statement's predicate.

getObject

public Value getObject()
Description copied from interface: Statement
Gets the object of this statement.

Specified by:
getObject in interface Statement
Returns:
The statement's object.

equals

public boolean equals(Object other)
Description copied from interface: Statement
Compares a statement object to another object.

Specified by:
equals in interface Statement

hashCode

public int hashCode()
Description copied from interface: Statement
The hash code of a statement is defined as follows:
 (0xFF0000 & subject.hashCode()) |
 (0x00FF00 & predicate.hashCode()) |
 (0x0000FF & object.hashCode());
 

Specified by:
hashCode in interface Statement

compareTo

public int compareTo(Object o)
Compares this Statement with the supplied object.

Specified by:
compareTo in interface Comparable
Throws:
ClassCastException - if o is not of type Statement
See Also:
Comparable

toString

public String toString()
Gives a String-representation of this Statement that can be used for debugging.



Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.