T - The type of objects to iterate.TIterator - The type of iterator that is transformed.public class TransformIter<T,TIterator extends IInpIter<T,TIterator>> extends java.lang.Object implements IInpIter<T,TransformIter<T,TIterator>>
| Constructor and Description |
|---|
TransformIter(TIterator iter,
IFunc1Arg<T,T> func)
Constructs a transform iterator from an input iterator and
the specified unary function object.
|
TransformIter(TransformIter<T,TIterator> iter)
Constructs a new instance from another iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Advance(int offset)
Adds an offset to an iterator.
|
void |
Advance(long offset)
Adds an offset to an iterator.
|
IteratorCategory |
Category()
Gets the iterator category.
|
TransformIter<T,TIterator> |
Copy()
Creates and returns a copy of the current instance.
|
T |
Current()
Returns the transformed value of the underlying iterator.
|
void |
Dispose()
Performs application-defined tasks associated with freeing, releasing,
or resetting system resources or other cleanup.
|
long |
Distance(TransformIter<T,TIterator> other)
Determines the number of increments between
this instance and a specified iterator.
|
boolean |
equals(java.lang.Object obj)
Tests whether this instance is equal to a specified
object.
|
boolean |
Equals(TransformIter<T,TIterator> other)
Tests whether this instance is equal to a specified
object.
|
int |
hashCode()
Returns the hash code for this instance.
|
void |
Increment()
Increments the iterator.
|
void |
ResetBegin()
Sets the iterator to its initial position,
which is before the first element in the container.
|
void |
ResetEnd()
Sets the iterator to its final position,
which is after the last element in the container.
|
public TransformIter(TIterator iter, IFunc1Arg<T,T> func)
iter - The specified iterator that is transformed.func - The unary function object.public TransformIter(TransformIter<T,TIterator> iter)
iter - The iterator to copy.public void Dispose()
Dispose in interface IDisposablepublic IteratorCategory Category()
public TransformIter<T,TIterator> Copy()
public T Current()
public void ResetBegin()
Remarks: At this position, Current is undefined. Therefore, you must call Increment to advance the iterator to the first element of the container before reading the value of Current.
ResetBegin in interface IBaseIter<TransformIter<T,TIterator extends IInpIter<T,TIterator>>>public void ResetEnd()
Remarks: At this position, Current is undefined. Therefore, you must call Decrement to advance the iterator to the last element of the container before reading the value of Current.
public void Increment()
public void Advance(int offset)
public void Advance(long offset)
public long Distance(TransformIter<T,TIterator> other)
Distance in interface IBaseIter<TransformIter<T,TIterator extends IInpIter<T,TIterator>>>other - An iterator addressing the position
one past the final element in the range [this, other).InvalidOperationException - Thrown when the
argument iterator is invalid, or it is not reachable from the current
instance.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - An object to compare with this instance.public int hashCode()
hashCode in class java.lang.Objectpublic boolean Equals(TransformIter<T,TIterator> other)
Equals in interface IEquatable<TransformIter<T,TIterator extends IInpIter<T,TIterator>>>other - An object to compare with this instance.Copyright© 2012 Progeneric Systems, Inc. All Rights Reserved.