org.mulgara.mrg
Class PropertyValue

java.lang.Object
  extended by org.mulgara.util.Pair<PredicateNode,ObjectNode>
      extended by org.mulgara.mrg.PropertyValue
All Implemented Interfaces:
Map.Entry<PredicateNode,ObjectNode>

public class PropertyValue
extends Pair<PredicateNode,ObjectNode>

An RDF property value


Field Summary
 
Fields inherited from class org.mulgara.util.Pair
_1, _2
 
Constructor Summary
PropertyValue(Node p, Node o)
          Create a new triple.
PropertyValue(Pair<PredicateNode,ObjectNode> pair)
          Create a new property value.
PropertyValue(PredicateNode p, ObjectNode o)
          Create a new property value.
PropertyValue(PredicateNode p, String o)
          Create a new property value with a string literal.
 
Method Summary
 boolean equals(Object o)
          Equality method.
 ObjectNode getObject()
          Gets the object
 PredicateNode getPredicate()
          Gets the predicate
 PredicateNode getProperty()
          Gets the predicate
 ObjectNode getValue()
          Gets the value
 String toString()
          Prints a simple representation of the property value.
 
Methods inherited from class org.mulgara.util.Pair
getFirst, getKey, getSecond, hashCode, setValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyValue

public PropertyValue(PredicateNode p,
                     ObjectNode o)
Create a new property value.

Parameters:
p - The property.
o - The value.

PropertyValue

public PropertyValue(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:
p - The predicate.
o - The object.
Throws:
ClassCastException - If an incompatible type is provided in p or o.

PropertyValue

public PropertyValue(Pair<PredicateNode,ObjectNode> pair)
Create a new property value.

Parameters:
pair - The generalized property value.

PropertyValue

public PropertyValue(PredicateNode p,
                     String o)
Create a new property value with a string literal.

Parameters:
p - The property.
o - The object.
Method Detail

getPredicate

public PredicateNode getPredicate()
Gets the predicate


getProperty

public PredicateNode getProperty()
Gets the predicate


getObject

public ObjectNode getObject()
Gets the object


getValue

public ObjectNode getValue()
Gets the value

Specified by:
getValue in interface Map.Entry<PredicateNode,ObjectNode>
Overrides:
getValue in class Pair<PredicateNode,ObjectNode>

equals

public boolean equals(Object o)
Equality method.

Specified by:
equals in interface Map.Entry<PredicateNode,ObjectNode>
Overrides:
equals in class Pair<PredicateNode,ObjectNode>

toString

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

Overrides:
toString in class Pair<PredicateNode,ObjectNode>


Copyright © 2011. All Rights Reserved.