public abstract class OIdentifiableIterator<REC extends OIdentifiable> extends Object implements Iterator<REC>, Iterable<REC>
Modifier and Type | Field and Description |
---|---|
protected long |
browsedRecords |
protected ORecordId |
current |
protected int |
currentTxEntryPosition |
protected ODatabaseDocumentInternal |
database |
protected long |
firstClusterEntry |
protected long |
lastClusterEntry |
protected long |
limit |
protected boolean |
liveUpdated |
protected OStorage.LOCKING_STRATEGY |
lockingStrategy |
protected long |
totalAvailableRecords |
protected List<ORecordOperation> |
txEntries |
Constructor and Description |
---|
OIdentifiableIterator(ODatabaseDocumentInternal iDatabase) |
OIdentifiableIterator(ODatabaseDocumentInternal iDatabase,
OStorage.LOCKING_STRATEGY iLockingStrategy)
Deprecated.
usage of this constructor may lead to deadlocks.
|
Modifier and Type | Method and Description |
---|---|
abstract OIdentifiableIterator<REC> |
begin() |
protected boolean |
checkCurrentPosition() |
protected void |
checkDirection(boolean iForward) |
protected void |
checkForSystemClusters(ODatabaseDocumentInternal iDatabase,
int[] iClusterIds) |
ORecord |
current() |
protected long |
currentPosition() |
Set<ORID> |
getBrokenRIDs() |
long |
getCurrentEntry() |
String |
getFetchPlan() |
long |
getLimit()
Return the current limit on browsing record.
|
protected ORecord |
getRecord()
Return the record to use for the operation.
|
protected ORecord |
getTransactionEntry() |
abstract boolean |
hasPrevious() |
boolean |
isLiveUpdated()
Return current configuration of live updates.
|
boolean |
isReuseSameRecord()
Tells if the iterator is using the same record for browsing.
|
Iterator<REC> |
iterator()
Return the iterator to be used in Java5+ constructs
for( ORecordDocument rec : database.browseCluster( "Animal" ) ){ |
abstract OIdentifiableIterator<REC> |
last() |
protected boolean |
nextPosition() |
abstract OIdentifiable |
previous() |
protected boolean |
prevPosition() |
protected ORecord |
readCurrentRecord(ORecord iRecord,
int iMovement)
Read the current record and increment the counter if the record was found.
|
void |
remove() |
protected void |
resetCurrentPosition() |
void |
setFetchPlan(String fetchPlan) |
OIdentifiableIterator<REC> |
setLimit(long limit)
Set the limit on browsing record.
|
OIdentifiableIterator<REC> |
setLiveUpdated(boolean liveUpdated)
Tell to the iterator that the upper limit must be checked at every cycle.
|
OIdentifiableIterator<REC> |
setReuseSameRecord(boolean reuseSameRecord)
Tell to the iterator to use the same record for browsing.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, hasNext, next
forEach, spliterator
protected final ODatabaseDocumentInternal database
protected final ORecordId current
protected boolean liveUpdated
protected long limit
protected long browsedRecords
protected OStorage.LOCKING_STRATEGY lockingStrategy
protected long totalAvailableRecords
protected List<ORecordOperation> txEntries
protected int currentTxEntryPosition
protected long firstClusterEntry
protected long lastClusterEntry
public OIdentifiableIterator(ODatabaseDocumentInternal iDatabase)
@Deprecated public OIdentifiableIterator(ODatabaseDocumentInternal iDatabase, OStorage.LOCKING_STRATEGY iLockingStrategy)
public abstract boolean hasPrevious()
public abstract OIdentifiable previous()
public abstract OIdentifiableIterator<REC> begin()
public abstract OIdentifiableIterator<REC> last()
public ORecord current()
public String getFetchPlan()
public void setFetchPlan(String fetchPlan)
public void remove()
remove
in interface Iterator<REC extends OIdentifiable>
public boolean isReuseSameRecord()
setReuseSameRecord(boolean)
public OIdentifiableIterator<REC> setReuseSameRecord(boolean reuseSameRecord)
reuseSameRecord
- if true the same record will be used for iteration. If false new record will be created each time
iterator retrieves record from db.public long getCurrentEntry()
public Iterator<REC> iterator()
for( ORecordDocument rec : database.browseCluster( "Animal" ) ){
...
}
iterator
in interface Iterable<REC extends OIdentifiable>
public long getLimit()
setLimit(long)
public OIdentifiableIterator<REC> setLimit(long limit)
limit
- The current limit on browsing record. -1 means no limits (default).getLimit()
public boolean isLiveUpdated()
setLiveUpdated(boolean)
public OIdentifiableIterator<REC> setLiveUpdated(boolean liveUpdated)
liveUpdated
- True to activate it, otherwise false (default)isLiveUpdated()
protected ORecord getTransactionEntry()
protected ORecord getRecord()
protected void checkDirection(boolean iForward)
protected ORecord readCurrentRecord(ORecord iRecord, int iMovement)
iRecord
- to read value from database inside it. If record is null link will be created and stored in it.protected boolean nextPosition()
protected boolean checkCurrentPosition()
protected boolean prevPosition()
protected void resetCurrentPosition()
protected long currentPosition()
protected void checkForSystemClusters(ODatabaseDocumentInternal iDatabase, int[] iClusterIds)
Copyright © 2009–2019 OrientDB. All rights reserved.