Class ArrayTool<T>
java.lang.Object
java.util.Observable
com.nomagic.magicreport.engine.Tool
com.nomagic.magicreport.engine.tools.ArrayTool<T>
- Type Parameters:
T- type
- All Implemented Interfaces:
ITool,IVariable,Serializable,Cloneable
Use for creating the Array or HashSet instance.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.nomagic.magicreport.engine.ITool
ITool.HTMLString, ITool.RetainedString, ITool.Void -
Field Summary
FieldsFields inherited from class com.nomagic.magicreport.engine.Tool
context, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCollection(Collection<T> parent, Collection<T> child) Add child list into parent collection.List<?> Create an emptyArrayList.createArray(Collection<T> collection) Constructs anArrayListcontaining the elements of the specified collection, in the order they are returned by the collection's iterator.Set<?> CreateHashSetinstance.Create ArrayList of the portion of list in given size.Methods inherited from class com.nomagic.magicreport.engine.Tool
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setPropertiesMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
-
Field Details
-
CONTEXT_NAME
Contains a context name.- See Also:
-
-
Constructor Details
-
ArrayTool
public ArrayTool()
-
-
Method Details
-
createArray
Create an emptyArrayList.- Returns:
- the instance of ArrayList.
-
createArray
Constructs anArrayListcontaining the elements of the specified collection, in the order they are returned by the collection's iterator. ReturnArrayListwith zero size if given collection isnull.- Parameters:
collection- the collection whose elements are to be placed into this list.- Returns:
- an
ArrayListcontaining the elements of the specified collection.
-
subList
Create ArrayList of the portion of list in given size.
If the size is out of bound (size <= 0 || size > list.size), the sub-list size 1 will be returned.- Parameters:
list- a original list.size- view size of given list- Returns:
- a
Listof view of the specified size within given list.
-
addCollection
Add child list into parent collection. It helps the template in order to handle the child is null.- Parameters:
parent- the parent collection.child- the child collection.
-
createHashSet
CreateHashSetinstance.- Returns:
- the instance of
HashSet.
-