@CodeReview(reviewer="Jonathan McClain", date="2006-05-16", changesNeeded=false, comments="A few comments, marked with triple slashes", response=@CodeReviewResponse(respondent="Kevin R. Dixon",date="2006-05-18",moreChangesNeeded=false,comments="Fixes from J.T.\'s code review")) public class MatrixUnionIterator extends java.lang.Object implements java.util.Iterator<TwoMatrixEntry>
Constructor and Description |
---|
MatrixUnionIterator(java.util.Iterator<MatrixEntry> firstIterator,
java.util.Iterator<MatrixEntry> secondIterator,
TwoMatrixEntry internalEntry,
EntryIndexComparator<MatrixEntry> indexComparator)
Creates a new instance of MatrixUnionIterator
|
Modifier and Type | Method and Description |
---|---|
protected void |
advanceInternalIterators()
Internal routine for advancing the internal iterators
|
MatrixEntry |
getFirstInternalEntry()
getter for firstInternalEntry
|
java.util.Iterator<MatrixEntry> |
getFirstIterator()
getter for firstInterator
|
EntryIndexComparator<MatrixEntry> |
getIndexComparator()
Gets the index comparator.
|
TwoMatrixEntry |
getInternalEntry()
getter for internalEntry
|
MatrixEntry |
getSecondInternalEntry()
getter for secondInternalEntry
|
java.util.Iterator<MatrixEntry> |
getSecondIterator()
getter for secondIterator
|
boolean |
hasNext() |
TwoMatrixEntry |
next() |
void |
remove() |
boolean |
safeFirstNext()
Try to advance the first entry...
|
boolean |
safeSecondNext()
Try to advance the second entry...
|
void |
setFirstInternalEntry(MatrixEntry firstInternalEntry)
setter for firstInternalEntry
|
void |
setFirstIterator(java.util.Iterator<MatrixEntry> firstIterator)
setter for firstInterator
|
protected void |
setIndexComparator(EntryIndexComparator<MatrixEntry> indexComparator)
Sets the index comparator.
|
void |
setInternalEntry(TwoMatrixEntry internalEntry)
setter for internalEntry
|
void |
setSecondInternalEntry(MatrixEntry secondInternalEntry)
setter for secondInternalEntry
|
void |
setSecondIterator(java.util.Iterator<MatrixEntry> secondIterator)
setter for secondIterator
|
public MatrixUnionIterator(java.util.Iterator<MatrixEntry> firstIterator, java.util.Iterator<MatrixEntry> secondIterator, TwoMatrixEntry internalEntry, EntryIndexComparator<MatrixEntry> indexComparator)
firstIterator
- Iterator from the first MatrixsecondIterator
- Iterator from the second MatrixinternalEntry
- TwoMatrixEntry for thisindexComparator
- The index comparator for the matrices.public java.util.Iterator<MatrixEntry> getFirstIterator()
public void setFirstIterator(java.util.Iterator<MatrixEntry> firstIterator)
firstIterator
- Iterator from the first Matrixpublic java.util.Iterator<MatrixEntry> getSecondIterator()
public void setSecondIterator(java.util.Iterator<MatrixEntry> secondIterator)
secondIterator
- Iterator from the second Matrixpublic MatrixEntry getFirstInternalEntry()
public void setFirstInternalEntry(MatrixEntry firstInternalEntry)
firstInternalEntry
- MatrixEntry for the first Matrixpublic MatrixEntry getSecondInternalEntry()
public void setSecondInternalEntry(MatrixEntry secondInternalEntry)
secondInternalEntry
- MatrixEntry from the second Matrixpublic TwoMatrixEntry getInternalEntry()
public void setInternalEntry(TwoMatrixEntry internalEntry)
internalEntry
- TwoMatrixEntry that contains the entries for both matricespublic EntryIndexComparator<MatrixEntry> getIndexComparator()
protected void setIndexComparator(EntryIndexComparator<MatrixEntry> indexComparator)
indexComparator
- The index comparator.public boolean safeFirstNext()
public boolean safeSecondNext()
protected void advanceInternalIterators()
public boolean hasNext()
hasNext
in interface java.util.Iterator<TwoMatrixEntry>
public TwoMatrixEntry next()
next
in interface java.util.Iterator<TwoMatrixEntry>
public void remove() throws java.lang.UnsupportedOperationException, java.util.NoSuchElementException
remove
in interface java.util.Iterator<TwoMatrixEntry>
java.lang.UnsupportedOperationException
- Always.java.util.NoSuchElementException
- If there is no element to remove.