Class IntegerList
- All Implemented Interfaces:
Iterable<Integer>,PrimitiveBeanCollection<Integer>
public class IntegerList
extends AnchorBean<IntegerList>
implements PrimitiveBeanCollection<Integer>
A bean defining a list of
Integers.
An example:
<datasets config-class="org.anchoranalysis.bean.primitive.IntegerList" config-factory="integerList">
<item>1</item>
<item>-4</item>
<item>8</item>
</datasets>
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionIntegerList(Integer... values) Constructs with one or more values added to the list. -
Method Summary
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IntegerList
Constructs with one or more values added to the list.- Parameters:
values- the values
-
-
Method Details
-
add
Description copied from interface:PrimitiveBeanCollectionAdd an element to the collection.- Specified by:
addin interfacePrimitiveBeanCollection<Integer>- Parameters:
value- the element to add.
-
contains
Description copied from interface:PrimitiveBeanCollectionWhether the collection contains a particular element?- Specified by:
containsin interfacePrimitiveBeanCollection<Integer>- Parameters:
value- the element to search for- Returns:
- true iff the collection contains the element.
-
iterator
-
isEmpty
public boolean isEmpty()Description copied from interface:PrimitiveBeanCollectionWhether the collection is empty or not.- Specified by:
isEmptyin interfacePrimitiveBeanCollection<Integer>- Returns:
- true iff the collection contains zero elements.
-
duplicateBean
Duplicate the bean.NOTE: We need to specifically-implement it as the
AnchorBeanfunctionality won't work with this implementation, as it uses non-default initialization (using a config-factory).- Overrides:
duplicateBeanin classAnchorBean<IntegerList>- Returns:
- the newly created bean
-
equals
-
canEqual
-
hashCode
public int hashCode()
-