ptolemy.backtrack.util
Class FieldRecord.CombinedIterator

java.lang.Object
  extended by ptolemy.backtrack.util.FieldRecord.CombinedIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
FieldRecord

public class FieldRecord.CombinedIterator
extends java.lang.Object
implements java.util.Iterator

Combinated iterator of all the dimensions. It returns records in their reversed timestamp order.

Since:
Ptolemy II 5.1
Version:
$Id: FieldRecord.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Thomas Feng
See Also:
FieldRecord.iterator()
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Field Summary
private  int _currentNum
          The number of records that have been returned by next().
private  FieldRecord.RecordList[] _currentRecords
          The current record for each dimension.
private  int _lastIndex
          The dimension of the last returned record.
private  FieldRecord.RecordList _lastRecord
          The last returned record.
 
Constructor Summary
FieldRecord.CombinedIterator()
          Construct an iterator.
 
Method Summary
private  int _maxTimestampIndex()
          Get the index of the maximum timestamp in the current records.
 boolean hasNext()
          Test if there are more elements.
 java.lang.Object next()
          Return the next element.
 void remove()
          Remove the last element returned by next().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_currentNum

private int _currentNum
The number of records that have been returned by next().


_currentRecords

private FieldRecord.RecordList[] _currentRecords
The current record for each dimension. Each current record is the next record to be returned by next() for that index, or null if no more record for that dimension.


_lastIndex

private int _lastIndex
The dimension of the last returned record.


_lastRecord

private FieldRecord.RecordList _lastRecord
The last returned record.

Constructor Detail

FieldRecord.CombinedIterator

FieldRecord.CombinedIterator()
Construct an iterator.

Method Detail

hasNext

public boolean hasNext()
Test if there are more elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there are more elements.

next

public java.lang.Object next()
Return the next element.

Specified by:
next in interface java.util.Iterator
Returns:
The next element.

remove

public void remove()
Remove the last element returned by next(). This function must be called after next().

Specified by:
remove in interface java.util.Iterator

_maxTimestampIndex

private int _maxTimestampIndex()
Get the index of the maximum timestamp in the current records.

Returns:
The index.