Package io.cui.tools.collect
Class PartialArrayList<T extends Serializable>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- io.cui.tools.collect.PartialArrayList<T>
-
- Type Parameters:
T- at leastSerializable
- All Implemented Interfaces:
PartialCollection<T>,Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess
public class PartialArrayList<T extends Serializable> extends ArrayList<T> implements PartialCollection<T>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description PartialArrayList(Collection<T> list, boolean moreAvailable)Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)static <T extends Serializable>
PartialArrayList<T>emptyList()Static constructor for an empty instance.booleanequals(Object o)inthashCode()booleanisMoreAvailable()isMoreAvailable.static <T extends Serializable>
PartialArrayList<T>of(List<T> full, int limit)Convenience method for creating aPartialArrayListas sublist for the given collection with setting thePartialCollection.isMoreAvailable()automaticallyStringtoString()-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
PartialArrayList
public PartialArrayList(Collection<T> list, boolean moreAvailable)
Default constructor.- Parameters:
list- the list of entities to store.moreAvailable- the flag to store.
-
-
Method Detail
-
emptyList
public static <T extends Serializable> PartialArrayList<T> emptyList()
Static constructor for an empty instance.- Type Parameters:
T-- Returns:
- an empty
PartialArrayList.
-
of
public static <T extends Serializable> PartialArrayList<T> of(List<T> full, int limit)
Convenience method for creating aPartialArrayListas sublist for the given collection with setting thePartialCollection.isMoreAvailable()automatically- Type Parameters:
T- identifying the type of contained elements- Parameters:
full- the complete List to be wrapped, may be larger than the limit. If so, a sublist will be used.limit- to be checked against- Returns:
- a newly created
PartialArrayList.
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<T extends Serializable>- Specified by:
equalsin interfaceList<T extends Serializable>- Overrides:
equalsin classArrayList<T extends Serializable>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<T extends Serializable>- Specified by:
hashCodein interfaceList<T extends Serializable>- Overrides:
hashCodein classArrayList<T extends Serializable>
-
toString
public String toString()
- Overrides:
toStringin classAbstractCollection<T extends Serializable>
-
isMoreAvailable
public boolean isMoreAvailable()
Description copied from interface:PartialCollectionisMoreAvailable.
- Specified by:
isMoreAvailablein interfacePartialCollection<T extends Serializable>- Returns:
trueif more entities are available and ignored due to the given limit.
-
-