Package it.unive.lisa.util.collections
Class IterableArray<E>
- java.lang.Object
-
- it.unive.lisa.util.collections.IterableArray<E>
-
- Type Parameters:
E
- the element type of the underlying array
- All Implemented Interfaces:
java.lang.Iterable<E>
public class IterableArray<E> extends java.lang.Object implements java.lang.Iterable<E>
An iterable over an array of elements.
-
-
Constructor Summary
Constructors Constructor Description IterableArray(E[] array)
Builds the iterable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
java.util.Iterator<E>
iterator()
int
size()
Yields the size of this iterable, that is, the length of the array behind this iterable.java.lang.String
toString()
-
-
-
Constructor Detail
-
IterableArray
public IterableArray(E[] array)
Builds the iterable.- Parameters:
array
- the underlying array
-
-
Method Detail
-
size
public int size()
Yields the size of this iterable, that is, the length of the array behind this iterable.- Returns:
- the size
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-