org.mulgara.mrg
Class Triple

java.lang.Object
  extended by org.mulgara.util.Trio<SubjectNode,PredicateNode,ObjectNode>
      extended by org.mulgara.mrg.Triple

public class Triple
extends Trio<SubjectNode,PredicateNode,ObjectNode>

An RDF triple


Field Summary
 
Fields inherited from class org.mulgara.util.Trio
_1, _2, _3
 
Constructor Summary
Triple(Node[] t)
          Create a new triple.
Triple(Node s, Node p, Node o)
          Create a new triple.
Triple(String s, PredicateNode p, ObjectNode o)
          Create a new triple.
Triple(String s, PredicateNode p, String o)
          Create a new triple.
Triple(String s, PredicateNode p, URI o)
          Create a new triple.
Triple(String s, String p, ObjectNode o)
          Create a new triple.
Triple(String s, String p, String o)
          Create a new triple.
Triple(String s, String p, URI o)
          Create a new triple.
Triple(String s, URI p, ObjectNode o)
          Create a new triple.
Triple(String s, URI p, String o)
          Create a new triple.
Triple(String s, URI p, URI o)
          Create a new triple.
Triple(SubjectNode s, PredicateNode p, ObjectNode o)
          Create a new triple.
Triple(SubjectNode s, PredicateNode p, String o)
          Create a new triple with a string literal.
Triple(SubjectNode s, PredicateNode p, URI o)
          Create a new triple.
Triple(SubjectNode s, String p, ObjectNode o)
          Create a new triple.
Triple(SubjectNode s, String p, String o)
          Create a new triple.
Triple(SubjectNode s, String p, URI o)
          Create a new triple.
Triple(SubjectNode s, URI p, ObjectNode o)
          Create a new triple.
Triple(SubjectNode s, URI p, String o)
          Create a new triple.
Triple(SubjectNode s, URI p, URI o)
          Create a new triple.
Triple(Trio<SubjectNode,PredicateNode,ObjectNode> t)
          Create a new triple.
Triple(URI s, PredicateNode p, ObjectNode o)
          Create a new triple.
Triple(URI s, PredicateNode p, String o)
          Create a new triple.
Triple(URI s, PredicateNode p, URI o)
          Create a new triple.
Triple(URI s, String p, ObjectNode o)
          Create a new triple.
Triple(URI s, String p, String o)
          Create a new triple.
Triple(URI s, String p, URI o)
          Create a new triple.
Triple(URI s, URI p, ObjectNode o)
          Create a new triple.
Triple(URI s, URI p, String o)
          Create a new triple.
Triple(URI s, URI p, URI o)
          Create a new triple.
 
Method Summary
 boolean equals(Object o)
          Equality method.
 ObjectNode getObject()
          Gets the object
 PredicateNode getPredicate()
          Gets the predicate
 SubjectNode getSubject()
          Gets the subject
 String toString()
          Prints a simple representation of the triple.
 
Methods inherited from class org.mulgara.util.Trio
getFirst, getSecond, getThird, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Triple

public Triple(SubjectNode s,
              PredicateNode p,
              ObjectNode o)
Create a new triple.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(Node s,
              Node p,
              Node o)
Create a new triple. This is an overloaded version of the first constructor accepting Nodes instead of the more specific types. Consequently, this method can throw a ClassCastException if the wrong types are provided.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
ClassCastException - If an incompatible type is provided in s, p or o.

Triple

public Triple(Trio<SubjectNode,PredicateNode,ObjectNode> t)
Create a new triple.

Parameters:
t - The generalized Triple.

Triple

public Triple(Node[] t)
Create a new triple.

Parameters:
t - An array of the triple elements. The parameters must be of the correct types.
Throws:
ClassCastException - If the array contains Nodes of the wrong types for their position.

Triple

public Triple(SubjectNode s,
              PredicateNode p,
              String o)
Create a new triple with a string literal.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(URI s,
              PredicateNode p,
              ObjectNode o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(SubjectNode s,
              URI p,
              ObjectNode o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(SubjectNode s,
              PredicateNode p,
              URI o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(URI s,
              URI p,
              ObjectNode o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(SubjectNode s,
              URI p,
              URI o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(URI s,
              PredicateNode p,
              URI o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(URI s,
              URI p,
              URI o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(String s,
              PredicateNode p,
              ObjectNode o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(SubjectNode s,
              String p,
              ObjectNode o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              String p,
              ObjectNode o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              URI p,
              ObjectNode o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(URI s,
              String p,
              ObjectNode o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(SubjectNode s,
              String p,
              String o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(SubjectNode s,
              URI p,
              String o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(SubjectNode s,
              String p,
              URI o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              PredicateNode p,
              String o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(URI s,
              PredicateNode p,
              String o)
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.

Triple

public Triple(String s,
              PredicateNode p,
              URI o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              String p,
              String o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(URI s,
              String p,
              String o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(URI s,
              URI p,
              String o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(URI s,
              String p,
              URI o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              URI p,
              String o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              URI p,
              URI o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.

Triple

public Triple(String s,
              String p,
              URI o)
       throws URISyntaxException
Create a new triple. Convenience constructor with automatic type conversion.

Parameters:
s - The subject.
p - The predicate.
o - The object.
Throws:
URISyntaxException - A string could not be converted to a Uri.
Method Detail

getSubject

public SubjectNode getSubject()
Gets the subject


getPredicate

public PredicateNode getPredicate()
Gets the predicate


getObject

public ObjectNode getObject()
Gets the object


equals

public boolean equals(Object o)
Equality method. Based on the wrapped URI.

Overrides:
equals in class Trio<SubjectNode,PredicateNode,ObjectNode>

toString

public String toString()
Prints a simple representation of the triple.

Overrides:
toString in class Trio<SubjectNode,PredicateNode,ObjectNode>


Copyright © 2011. All Rights Reserved.