Package org.silverpeas.core.util
Class CollectionUtil.RuptureContext<T>
- java.lang.Object
-
- org.silverpeas.core.util.CollectionUtil.RuptureContext<T>
-
- Type Parameters:
T
- the type of the items in the list
- Enclosing class:
- CollectionUtil
public static class CollectionUtil.RuptureContext<T> extends Object
Handles the context of a rupture treatment.
It must by initialized by callingnewOne(List)
after usingCollectionUtil.findNextRupture(RuptureContext, Predicate)
.
Callers can verify if it is no more possible to get an element from the rupture by callingisTerminated()
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isTerminated()
Indicates if the rupture is terminated.static <T> CollectionUtil.RuptureContext<T>
newOne(List<T> orderedList)
Initializes a new context with the given ordered list.void
reset()
Resets the rupture as the caller was initializing a new one withnewOne(List)
.
-
-
-
Method Detail
-
newOne
public static <T> CollectionUtil.RuptureContext<T> newOne(List<T> orderedList)
Initializes a new context with the given ordered list.- Type Parameters:
T
- the type of the items in the list- Parameters:
orderedList
- an ordered list.- Returns:
- the initialized context.
-
isTerminated
public boolean isTerminated()
Indicates if the rupture is terminated.- Returns:
- true if terminated, false otherwise.
-
reset
public void reset()
Resets the rupture as the caller was initializing a new one withnewOne(List)
.
-
-