Package org.ametys.plugins.repository
Class CollectionIterable<A extends AmetysObject>
java.lang.Object
org.ametys.plugins.repository.CollectionIterable<A>
- Type Parameters:
- A- the actual type of- AmetysObjects
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Iterable<A>,- AmetysObjectIterable<A>
public class CollectionIterable<A extends AmetysObject>
extends Object
implements AmetysObjectIterable<A>
Basic implementation of an 
AmetysObjectIterable based on an existing Collection.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close the associated resources.
 AnAmetysObjectIterablemust NOT be closed if any of the containedAmetysObjectis still in use.longgetSize()Returns the number of elements in this iterable.iterator()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObjectIterablespliterator, stream
- 
Constructor Details- 
CollectionIterableCreates aCollectionIterable.- Parameters:
- collection- the- AmetysObjects collection
 
 
- 
- 
Method Details- 
getSizeDescription copied from interface:AmetysObjectIterableReturns the number of elements in this iterable. If this information is unavailable, returns -1.- Specified by:
- getSizein interface- AmetysObjectIterable<A extends AmetysObject>
- Returns:
- a long
 
- 
iterator- Specified by:
- iteratorin interface- AmetysObjectIterable<A extends AmetysObject>
- Specified by:
- iteratorin interface- Iterable<A extends AmetysObject>
 
- 
closeDescription copied from interface:AmetysObjectIterableClose the associated resources.
 AnAmetysObjectIterablemust NOT be closed if any of the containedAmetysObjectis still in use.- Specified by:
- closein interface- AmetysObjectIterable<A extends AmetysObject>
- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
-