org.openanzo.common.rdb.query
Class IRIReference

java.lang.Object
  extended by org.openanzo.common.rdb.query.IRIReference
All Implemented Interfaces:
IRdbTerm, IRITerm, RDFTerm, TriplePatternComponent

public class IRIReference
extends java.lang.Object
implements IRdbTerm, IRITerm

Implementation of IRITerm that maps an Anzo Resource to a Glitter IRITerm

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
IRIReference(CompositeNodeLayout nodeLayout, long id)
          Create a new IRIReference for the URI with the given ID
IRIReference(java.lang.String uri)
          Create a new IRIReference for the given URI string
IRIReference(java.net.URI uri)
          Create a new IRIReference for the given java.net.URI
IRIReference(org.openrdf.model.URI uri)
          Create a new IRIReference for the given org.openrdf.model.URI
 
Method Summary
 void clear()
          Clear the cached values from term
 int compareTo(TriplePatternComponent o)
          Compares to TriplePatternComponents for ordering.
 boolean equals(java.lang.Object other)
           
 long getId()
          Get the ID of this node in the database
 org.openrdf.model.URI getNode(java.util.Map<java.lang.Long,org.openrdf.model.Value> alreadyStored)
          Get the Value of this URI
 java.net.URI getURI()
           
 org.openrdf.model.Value getValue()
          Get the Value representation of this term
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IRIReference

public IRIReference(java.net.URI uri)
Create a new IRIReference for the given java.net.URI

Parameters:
uri - java.net.URI representation of URI

IRIReference

public IRIReference(CompositeNodeLayout nodeLayout,
                    long id)
Create a new IRIReference for the URI with the given ID

Parameters:
nodeLayout - source of data
id - ID of URI

IRIReference

public IRIReference(java.lang.String uri)
             throws java.net.URISyntaxException
Create a new IRIReference for the given URI string

Parameters:
uri - String representation of a URI value
Throws:
java.net.URISyntaxException - if the provided URI string is invalid

IRIReference

public IRIReference(org.openrdf.model.URI uri)
Create a new IRIReference for the given org.openrdf.model.URI

Parameters:
uri - org.openrdf.model.URI representation of URI value
Method Detail

clear

public void clear()
Clear the cached values from term


getURI

public java.net.URI getURI()
Specified by:
getURI in interface IRITerm
Returns:
A URI for this IRI Glitter term.

getId

public long getId()
Description copied from interface: IRdbTerm
Get the ID of this node in the database

Specified by:
getId in interface IRdbTerm
Returns:
the ID of this node in the database

getNode

public org.openrdf.model.URI getNode(java.util.Map<java.lang.Long,org.openrdf.model.Value> alreadyStored)
Get the Value of this URI

Parameters:
alreadyStored - cache of IDs and their URI Values
Returns:
org.openrdf.model.URI representation of this URI

getValue

public org.openrdf.model.Value getValue()
Description copied from interface: IRdbTerm
Get the Value representation of this term

Specified by:
getValue in interface IRdbTerm
Returns:
the Value representation of this term

toString

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

equals

public boolean equals(java.lang.Object other)
Specified by:
equals in interface TriplePatternComponent
Overrides:
equals in class java.lang.Object

hashCode

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

compareTo

public int compareTo(TriplePatternComponent o)
Description copied from interface: TriplePatternComponent
Compares to TriplePatternComponents for ordering.

Specified by:
compareTo in interface TriplePatternComponent
Returns:
-1 if this comes before other; 0 if TriplePatternComponent.equals(Object) is true, and 1 otherwise.


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.