com.bigdata.rdf.inf
Class AbstractSPOBuffer

java.lang.Object
  extended by com.bigdata.rdf.inf.AbstractSPOBuffer
All Implemented Interfaces:
ISPOBuffer
Direct Known Subclasses:
SPOAssertionBuffer, SPORetractionBuffer

Deprecated. by AbstractArrayBuffer, but this class is more tightly coupled to the AbstractTripleStore.

public abstract class AbstractSPOBuffer
extends Object
implements ISPOBuffer

Abtract base class for buffering SPOs for some batch api operation.

Version:
$Id: AbstractSPOBuffer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
protected  int capacity
          Deprecated. The buffer capacity.
protected  IElementFilter<ISPO> filter
          Deprecated. An optional filter.
protected  int numStmts
          Deprecated. The #of statements currently in stmts
protected  ISPO[] stmts
          Deprecated. The array in which the statements are stored.
 
Fields inherited from interface com.bigdata.rdf.spo.ISPOBuffer
DEBUG, INFO, log
 
Constructor Summary
protected AbstractSPOBuffer(AbstractTripleStore store, IElementFilter<ISPO> filter, int capacity)
          Deprecated. Create a buffer.
 
Method Summary
 boolean add(ISPO stmt)
          Deprecated. Adds an ISPO.
 void dump(AbstractTripleStore store)
          Deprecated. Dumps the state of the buffer on System.err.
abstract  int flush()
          Deprecated. Flush any buffered statements to the backing store.
 ISPO get(int i)
          Deprecated. The SPO at the given index (used by some unit tests).
protected  AbstractTripleStore getTermDatabase()
          Deprecated. The database in which the term identifiers are defined - this is exposed ONLY for use in logging messages.
 boolean isEmpty()
          Deprecated. True iff there are no statements in the buffer.
protected  boolean nearCapacity()
          Deprecated. Returns true iff there is no more space remaining in the buffer.
 int size()
          Deprecated. The #of statements currently in the buffer.
 String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stmts

protected final ISPO[] stmts
Deprecated. 
The array in which the statements are stored.


numStmts

protected int numStmts
Deprecated. 
The #of statements currently in stmts


filter

protected final IElementFilter<ISPO> filter
Deprecated. 
An optional filter. When present, statements matched by the filter are NOT retained by the SPOAssertionBuffer.


capacity

protected final int capacity
Deprecated. 
The buffer capacity.

Constructor Detail

AbstractSPOBuffer

protected AbstractSPOBuffer(AbstractTripleStore store,
                            IElementFilter<ISPO> filter,
                            int capacity)
Deprecated. 
Create a buffer.

Parameters:
store - The database used to resolve term identifiers in log statements (optional).
filter - Option filter. When present statements matched by the filter are NOT retained by the SPOAssertionBuffer and will NOT be added to the store.
capacity - The maximum #of Statements, URIs, Literals, or BNodes that the buffer can hold.
Method Detail

size

public int size()
Deprecated. 
Description copied from interface: ISPOBuffer
The #of statements currently in the buffer.

Specified by:
size in interface ISPOBuffer

isEmpty

public boolean isEmpty()
Deprecated. 
Description copied from interface: ISPOBuffer
True iff there are no statements in the buffer.

Specified by:
isEmpty in interface ISPOBuffer

get

public ISPO get(int i)
Deprecated. 
The SPO at the given index (used by some unit tests).

Parameters:
i -
Returns:

getTermDatabase

protected AbstractTripleStore getTermDatabase()
Deprecated. 
The database in which the term identifiers are defined - this is exposed ONLY for use in logging messages.


nearCapacity

protected boolean nearCapacity()
Deprecated. 
Returns true iff there is no more space remaining in the buffer. Under those conditions adding another statement to the buffer could cause an overflow.

Returns:
True if the buffer might overflow if another statement were added.

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

flush

public abstract int flush()
Deprecated. 
Description copied from interface: ISPOBuffer
Flush any buffered statements to the backing store.

Specified by:
flush in interface ISPOBuffer
Returns:
The cumulative #of statements that were written on the indices since the last time the counter was reset. A statement that was previously an axiom or inferred and that is converted to an explicit statement by this method will be reported in this count as well as any statement that was not pre-existing in the database. Statement removal also counts as a "write".
See Also:
#flush(boolean)

add

public boolean add(ISPO stmt)
Deprecated. 
Description copied from interface: ISPOBuffer
Adds an ISPO.

Specified by:
add in interface ISPOBuffer
Parameters:
stmt - The ISPO.
Returns:
true if the buffer will store the statement (i.e., the statement is not excluded by the filter).

dump

public void dump(AbstractTripleStore store)
Deprecated. 
Dumps the state of the buffer on System.err.

Parameters:
store - Used to resolve the term identifiers to Values.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.