T
- public class JavaLightArray<T> extends Object implements LightArray<T>
LightArray
used on the jvmConstructor and Description |
---|
JavaLightArray()
Construct a
JavaLightArray |
Modifier and Type | Method and Description |
---|---|
static <T> JavaLightArray<T> |
fromSet(Set<T> set)
Construct a
JavaLightArray from a set |
T |
get(int index)
get the object at a specific index
|
int |
length()
the length of the array
|
void |
push(T value)
push a value on to the array
|
void |
set(int index,
T value)
put an object to a given index.
|
T |
shift()
pop a value from the array
|
void |
unshift(T value)
push a value onto the array
|
public JavaLightArray()
JavaLightArray
public T shift()
LightArray
shift
in interface LightArray<T>
public T get(int index)
LightArray
get
in interface LightArray<T>
index
- the indexpublic void set(int index, T value)
LightArray
set
in interface LightArray<T>
index
- the indexvalue
- the value to storepublic int length()
LightArray
length
in interface LightArray<T>
public void unshift(T value)
LightArray
unshift
in interface LightArray<T>
value
- to pushpublic void push(T value)
LightArray
push
in interface LightArray<T>
public static <T> JavaLightArray<T> fromSet(Set<T> set)
JavaLightArray
from a setT
- the types to store in the arrayset
- the set with the initial valuesCopyright © 2021 Magnolia International Ltd.. All rights reserved.