Package org.epics.util.array
Class ArrayBoolean
- java.lang.Object
-
- org.epics.util.array.ListBoolean
-
- org.epics.util.array.ArrayBoolean
-
- All Implemented Interfaces:
Serializable
public final class ArrayBoolean extends ListBoolean implements Serializable
Wraps aboolean[]
into aListBoolean
.- Author:
- Gabriele Carcassi
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayBoolean(boolean... array)
A new read-onlyArrayBoolean
that wraps around the given array.ArrayBoolean(boolean[] array, boolean readOnly)
A newArrayBoolean
that wraps around the given array.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
boolean
getBoolean(int index)
Returns the element at the specified position in this list.static ArrayBoolean
of(boolean... values)
Returns an unmodifiableArrayBoolean
wrapper for the givenboolean
array.void
setBoolean(int index, boolean value)
Changes the element at the specified position.int
size()
Returns the number of elements in the collection.-
Methods inherited from class org.epics.util.array.ListBoolean
hashCode
-
-
-
-
Constructor Detail
-
ArrayBoolean
public ArrayBoolean(boolean... array)
A new read-onlyArrayBoolean
that wraps around the given array.- Parameters:
array
- an array
-
ArrayBoolean
public ArrayBoolean(boolean[] array, boolean readOnly)
A newArrayBoolean
that wraps around the given array.- Parameters:
array
- an arrayreadOnly
- if false the wrapper allows writes to the array
-
-
Method Detail
-
size
public final int size()
Description copied from class:ListBoolean
Returns the number of elements in the collection.- Specified by:
size
in classListBoolean
- Returns:
- the number of elements in the collection
-
getBoolean
public boolean getBoolean(int index)
Description copied from class:ListBoolean
Returns the element at the specified position in this list.- Specified by:
getBoolean
in classListBoolean
- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
-
setBoolean
public void setBoolean(int index, boolean value)
Description copied from class:ListBoolean
Changes the element at the specified position.- Specified by:
setBoolean
in classListBoolean
- Parameters:
index
- position of the element to changevalue
- the new value
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classListBoolean
-
of
public static ArrayBoolean of(boolean... values)
Returns an unmodifiableArrayBoolean
wrapper for the givenboolean
array.- Parameters:
values
- a primitive array.- Returns:
- an immutable wrapper.
-
-