T
- type@OpenApiAll public class ArrayTool<T> extends Tool
ITool.HTMLString, ITool.RetainedString, ITool.Void
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXT_NAME
Contains a context name.
|
context, properties
Constructor and Description |
---|
ArrayTool() |
Modifier and Type | Method and Description |
---|---|
void |
addCollection(java.util.Collection<T> parent,
java.util.Collection<T> child)
Add child list into parent collection.
|
java.util.List<?> |
createArray()
Create an empty
ArrayList . |
java.util.List<T> |
createArray(java.util.Collection<T> collection)
Constructs an
ArrayList containing the elements of the specified collection, in the order they
are returned by the collection's iterator. |
java.util.Set<?> |
createHashSet()
Create
HashSet instance. |
java.util.List<java.util.List<T>> |
subList(java.util.List<T> list,
int size)
Create ArrayList of the portion of list in given size.
|
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setProperties
public static final java.lang.String CONTEXT_NAME
public java.util.List<?> createArray()
ArrayList
.public java.util.List<T> createArray(java.util.Collection<T> collection)
ArrayList
containing the elements of the specified collection, in the order they
are returned by the collection's iterator. Return ArrayList
with zero size if given collection
is null
.collection
- the collection whose elements are to be placed into this list.ArrayList
containing the elements of the specified collection.public java.util.List<java.util.List<T>> subList(java.util.List<T> list, int size)
list
- a original list.size
- view size of given listList
of view of the specified size within given list.public void addCollection(java.util.Collection<T> parent, java.util.Collection<T> child)
parent
- the parent collection.child
- the child collection.public java.util.Set<?> createHashSet()
HashSet
instance.HashSet
.Copyright © 2010 - No Magic Asia