org.jlab.hipo.data
Class HipoNodeBuilder<T extends java.lang.Number>
- java.lang.Object
-
- org.jlab.hipo.data.HipoNodeBuilder<T>
-
- Type Parameters:
T- node type to build, accepts classes extending Number
public class HipoNodeBuilder<T extends java.lang.Number> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description HipoNodeBuilder()Default Constructor.HipoNodeBuilder(int limit)Constructor with setting a limit on how many elements maximum can be stored in the builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description HipoNodebuildNode(int group, int item)Builds a node from the array, type is determined by Template.intgetSize()returns current size of the container.booleanisFull()returns false if the array capacity is less than predetermined maximum size of the node, if limit is negative it always returns false.voidpush(T value)adds an element of given type to the end of the list.voidreset()Resets the content of the node builder, the array is cleared.
-
-
-
Constructor Detail
-
HipoNodeBuilder
public HipoNodeBuilder()
Default Constructor. Sets the maximum limit of elements to negative number, therefore there is no restrictions on how many elements can be stored.
-
HipoNodeBuilder
public HipoNodeBuilder(int limit)
Constructor with setting a limit on how many elements maximum can be stored in the builder.- Parameters:
limit- maximum number of elements to store
-
-
Method Detail
-
push
public void push(T value)
adds an element of given type to the end of the list. the check is performed to see if the array has reached the maximum allowed size set by user.- Parameters:
value- element to add to the array.
-
isFull
public boolean isFull()
returns false if the array capacity is less than predetermined maximum size of the node, if limit is negative it always returns false.- Returns:
- true if maximum size is reached, false otherwise
-
getSize
public int getSize()
returns current size of the container.- Returns:
-
reset
public void reset()
Resets the content of the node builder, the array is cleared. the maximum size limit is not changed.
-
buildNode
public HipoNode buildNode(int group, int item)
Builds a node from the array, type is determined by Template.- Parameters:
group- group is for the nodeitem- item id for the node- Returns:
- HipoNode class
-
-
DMelt 3.0 © DataMelt by jWork.ORG