org.openanzo.model.impl
Class AnzoContextStatementImpl

java.lang.Object
  extended by org.openrdf.model.impl.StatementImpl
      extended by org.openrdf.model.impl.ContextStatementImpl
          extended by org.openanzo.model.impl.AnzoContextStatementImpl
All Implemented Interfaces:
java.io.Serializable, org.openrdf.model.Statement

public class AnzoContextStatementImpl
extends org.openrdf.model.impl.ContextStatementImpl

Extension of ContextStatementImpl that adds a few extra constraints.

  • Hashcode is stored so that it doesn't have to be recomputed every time its needed.
  • Checks that all values are set on creation, and throws exception if not.
  • Compares context of 2 statements during equals, if both have a context set.

    Author:
    Matthew Roy ( mroy@cambridgesemantics.com )
    See Also:
    Serialized Form

    Constructor Summary
    AnzoContextStatementImpl(org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj)
              Create new AnzoContextStatementImpl with the given values
    AnzoContextStatementImpl(org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj, org.openrdf.model.Resource context)
              Create new AnzoContextStatementImpl with the given values
     
    Method Summary
     boolean equals(java.lang.Object otherStmt)
               
     int hashCode()
               
     
    Methods inherited from class org.openrdf.model.impl.ContextStatementImpl
    getContext, toString
     
    Methods inherited from class org.openrdf.model.impl.StatementImpl
    getObject, getPredicate, getSubject
     
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    AnzoContextStatementImpl

    public AnzoContextStatementImpl(org.openrdf.model.Resource subj,
                                    org.openrdf.model.URI prop,
                                    org.openrdf.model.Value obj,
                                    org.openrdf.model.Resource context)
    Create new AnzoContextStatementImpl with the given values

    Parameters:
    subj - Subject of statement
    prop - Property of statement
    obj - Object of statement
    context - Context of statement
    Throws:
    AnzoRuntimeException - if subj,prop, or obj are null

    AnzoContextStatementImpl

    public AnzoContextStatementImpl(org.openrdf.model.Resource subj,
                                    org.openrdf.model.URI prop,
                                    org.openrdf.model.Value obj)
    Create new AnzoContextStatementImpl with the given values

    Parameters:
    subj - Subject of statement
    prop - Property of statement
    obj - Object of statement
    Throws:
    AnzoRuntimeException - if subj,prop, or obj are null
    Method Detail

    equals

    public boolean equals(java.lang.Object otherStmt)
    Specified by:
    equals in interface org.openrdf.model.Statement
    Overrides:
    equals in class org.openrdf.model.impl.StatementImpl

    hashCode

    public int hashCode()
    Specified by:
    hashCode in interface org.openrdf.model.Statement
    Overrides:
    hashCode in class org.openrdf.model.impl.StatementImpl


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