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 booleanequals(java.lang.Object obj)inthashCode()java.util.Iterator<E>iterator()intsize()Yields the size of this iterable, that is, the length of the array behind this iterable.java.lang.StringtoString()
-
-
-
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-