|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.database.DbBlockIterator
public class DbBlockIterator
A class that defines the logic to iterate through an array of long unique ID's of Jive objects,
and to load those objects in blocks rather than all at once or one at a time. This class operates
in two modes, one which uses an array of object ids and a type id (one of the constants defined in
JiveConstants
, and another which uses an array of EntityDescriptor
s which allows the
iterator to deal with lists of homogeneous types.
Constructor Summary | |
---|---|
DbBlockIterator(EntityDescriptor[] block,
CachedPreparedStatement query,
int startIndex,
int endIndex,
int parentObjectType,
long parentObjectID)
Constructs a new DbBlockIterator. |
|
DbBlockIterator(long[] block,
CachedPreparedStatement query,
int startIndex,
int endIndex,
int objectType,
int parentObjectType,
long parentObjectID)
Constructs a new DbBlockIterator. |
|
DbBlockIterator(long[] block,
CachedPreparedStatement query,
int startIndex,
int endIndex,
int objectType,
int parentObjectType,
long parentObjectID,
boolean loadIDs)
Constructs a new DbBlockIterator. |
Method Summary | |
---|---|
protected long[] |
getBlock(int startIndex)
|
protected java.lang.Object |
getElement(int index)
Returns the element at the specified index |
protected EntityDescriptor[] |
getEntityBlock(int startIndex)
|
protected java.lang.Object |
getNextElement()
Returns the next element, or null if there are no more elements to return. |
protected java.lang.Object |
getObject(long objectID,
int objectType)
|
protected java.lang.Object |
getPreviousElement()
Returns the previous element, or null if there are no more elements to return. |
boolean |
hasNext()
|
boolean |
hasPrevious()
|
java.util.Iterator |
iterator()
|
java.lang.Object |
next()
|
long |
nextID()
|
java.lang.Object |
previous()
|
void |
remove()
|
void |
setIndex(long objectID)
|
void |
skipElement()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DbBlockIterator(long[] block, CachedPreparedStatement query, int startIndex, int endIndex, int objectType, int parentObjectType, long parentObjectID)
block
- the array of id's to iterate through.query
- the query used to select the block.startIndex
- the starting index in the block to being iteration at.endIndex
- the endeding index in the set to end iteration at. This may or not be in the
current block. If it ends after the current block, the next block will be loaded
automatically as necessary.objectType
- the object type associated with this block.parentObjectType
- the object type of the parent object associated with this block.parentObjectID
- the ID of the parent object associated with this block.public DbBlockIterator(long[] block, CachedPreparedStatement query, int startIndex, int endIndex, int objectType, int parentObjectType, long parentObjectID, boolean loadIDs)
block
- the array of id's to iterate through.query
- the query used to select the block.startIndex
- the starting index in the block to being iteration at.endIndex
- the ending index in the set to end iteration at. This may or not be in the
current block. If it ends after the current block, the next block will be loaded
automatically as necessary.objectType
- the object type associated with this block.parentObjectType
- the object type of the parent object associated with this block.parentObjectID
- the ID of the parent object associated with this block.loadIDs
- load IDs instead of objects. This is primarily designed to be used for
permission checking.public DbBlockIterator(EntityDescriptor[] block, CachedPreparedStatement query, int startIndex, int endIndex, int parentObjectType, long parentObjectID)
block
- the array of EntityDescriptor
's to iterate through.query
- the query used to select the block.startIndex
- the starting index in the block to being iteration at.endIndex
- the ending index in the set to end iteration at. This may or not be in the
current block. If it ends after the current block, the next block will be loaded
automatically as necessary.parentObjectType
- the object type of the parent object associated with this block.parentObjectID
- the ID of the parent object associated with this block.Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public boolean hasPrevious()
public java.lang.Object next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator
java.util.NoSuchElementException
public long nextID()
public void skipElement()
public java.lang.Object previous()
public void remove()
remove
in interface java.util.Iterator
public void setIndex(long objectID)
public java.util.Iterator iterator()
protected long[] getBlock(int startIndex) throws java.lang.Exception
java.lang.Exception
protected EntityDescriptor[] getEntityBlock(int startIndex) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object getNextElement()
protected java.lang.Object getPreviousElement()
protected java.lang.Object getElement(int index)
index
- the index to get the element for
protected java.lang.Object getObject(long objectID, int objectType) throws java.lang.Exception
java.lang.Exception
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |