de.hedenus.rdf
Class SPIndex

java.lang.Object
  extended by de.hedenus.rdf.SPIndex
All Implemented Interfaces:
java.io.Serializable

public class SPIndex
extends java.lang.Object
implements java.io.Serializable

A special (fast) index for accessing statements by their subject and predicate.

Author:
Michael Hedenus
See Also:
Serialized Form

Constructor Summary
SPIndex()
          Creates a table with inital capacity of 128.
SPIndex(int initialLength)
          Creates a table with an inital capacity which must be a power of two.
 
Method Summary
 void add(Statement statement)
          Adds a statement to the index.
 Statement[] get(java.lang.String subject, java.lang.String predicate)
          Returns an array of Statements for the given subject and predicate or null if there is no statement.
 float getLoadFactor()
           
 int getSize()
          Returns the number of indexed statements.
 boolean isEmpty()
           
 void setLoadFactor(float loadFactor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPIndex

public SPIndex()
Creates a table with inital capacity of 128.


SPIndex

public SPIndex(int initialLength)
Creates a table with an inital capacity which must be a power of two.

Method Detail

getSize

public int getSize()
Returns the number of indexed statements.


isEmpty

public boolean isEmpty()

getLoadFactor

public float getLoadFactor()

setLoadFactor

public void setLoadFactor(float loadFactor)

get

public Statement[] get(java.lang.String subject,
                       java.lang.String predicate)
Returns an array of Statements for the given subject and predicate or null if there is no statement.
Note: The returned array is live, do not change it!


add

public void add(Statement statement)
Adds a statement to the index.