edu.rice.cs.plt.iter
Class AbstractIterable<T>

java.lang.Object
  extended by edu.rice.cs.plt.iter.AbstractIterable<T>
All Implemented Interfaces:
java.lang.Iterable<T>
Direct Known Subclasses:
BinaryMappedIterable, CartesianIterable, CollapsedIterable, ComposedIterable, ConsList, DiagonalCartesianIterable, EmptyIterable, EventSequence, FilteredIterable, ImmutableIterable, MappedIterable, PermutationIterable, SingletonIterable, SkipFirstIterable, SkipLastIterable, SnapshotIterable, TruncatedIterable

public abstract class AbstractIterable<T>
extends java.lang.Object
implements java.lang.Iterable<T>

A parent class for iterables that implements toString, hashCode, and equals.


Constructor Summary
AbstractIterable()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Defers to IterUtil.isEqual(java.lang.Iterable, java.lang.Iterable) (unless obj is not an AbstractIterable).
 int hashCode()
          Defers to IterUtil.hashCode(java.lang.Iterable).
 java.lang.String toString()
          Defers to IterUtil.toString(java.lang.Iterable).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

AbstractIterable

public AbstractIterable()
Method Detail

toString

public java.lang.String toString()
Defers to IterUtil.toString(java.lang.Iterable).

Overrides:
toString in class java.lang.Object

equals

public final boolean equals(java.lang.Object obj)
Defers to IterUtil.isEqual(java.lang.Iterable, java.lang.Iterable) (unless obj is not an AbstractIterable). It's tempting to check for equality whenever obj is any iterable, but that would break the contract of equals(), since it would not necessarily be symmetric. See Collection.equals(java.lang.Object) for further discussion.

Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Defers to IterUtil.hashCode(java.lang.Iterable).

Overrides:
hashCode in class java.lang.Object