
public class JreArrayOfNumber extends Object implements ArrayOfNumber
| Constructor and Description |
|---|
JreArrayOfNumber() |
| Modifier and Type | Method and Description |
|---|---|
ArrayOfNumber |
concat(ArrayOfNumber values)
Returns a new array that is the concatenation of this array and
values. |
boolean |
contains(double value) |
double |
get(int index)
Gets the value at a given index.
|
int |
indexOf(double value) |
void |
insert(int index,
double value)
Inserts a new element into the array at the specified index.
|
boolean |
isEmpty()
Returns true if the length of the array is zero.
|
boolean |
isSet(int index)
Check that the specified
index has been initialized to a valid
value. |
String |
join()
Convert each element of the array to a String and join them with a comma
separator.
|
String |
join(String separator)
Convert each element of the array to a String and join them with a comma
separator.
|
int |
length()
Gets the length of the array.
|
double |
peek()
Returns the last value of the array;
|
double |
pop()
Remove and return the element from the end of the array.
|
void |
push(double value)
Pushes the given number onto the end of the array.
|
void |
remove(double value) |
void |
removeByIndex(int index)
Removes the element at the specified index.
|
void |
set(int index,
double value)
Sets the value value at a given index.
|
void |
setLength(int length)
Reset the length of the array.
|
double |
shift()
Shifts the first value off the array.
|
void |
sort()
Sorts the contents of the array in ascending order.
|
void |
sort(CanCompareNumber comparator)
Sorts the contents of the Array based on the
CanCompareNumber. |
ArrayOfNumber |
splice(int index,
int count)
Removes the specified number of elements starting at index and returns the
removed elements.
|
void |
unshift(double value)
Shifts a value onto the beginning of the array.
|
public ArrayOfNumber concat(ArrayOfNumber values)
ArrayOfNumber
values. This method does not mutate the current array.concat in interface ArrayOfNumberpublic boolean contains(double value)
public double get(int index)
ArrayOfNumberget in interface ArrayOfNumberindex - the index to be retrievedpublic int indexOf(double value)
public void insert(int index,
double value)
ArrayOfNumberinsert in interface ArrayOfNumberpublic boolean isEmpty()
ArrayOfNumberisEmpty in interface ArrayOfNumberpublic boolean isSet(int index)
ArrayOfNumberindex has been initialized to a valid
value.isSet in interface ArrayOfNumberpublic String join()
ArrayOfNumberjoin in interface ArrayOfNumberpublic String join(String separator)
ArrayOfNumberjoin in interface ArrayOfNumberpublic int length()
ArrayOfNumberlength in interface ArrayOfNumberpublic double peek()
ArrayOfNumberpeek in interface ArrayOfNumberpublic double pop()
ArrayOfNumberpop in interface ArrayOfNumberpublic void push(double value)
ArrayOfNumberpush in interface ArrayOfNumberpublic void remove(double value)
public void removeByIndex(int index)
ArrayOfNumberremoveByIndex in interface ArrayOfNumberpublic void set(int index,
double value)
ArrayOfNumberset in interface ArrayOfNumberindex - the index to be setvalue - the value to be storedpublic void setLength(int length)
ArrayOfNumbersetLength in interface ArrayOfNumberlength - the new length of the arraypublic double shift()
ArrayOfNumbershift in interface ArrayOfNumberpublic void sort()
ArrayOfNumbersort in interface ArrayOfNumberpublic void sort(CanCompareNumber comparator)
ArrayOfNumberCanCompareNumber.sort in interface ArrayOfNumberpublic ArrayOfNumber splice(int index, int count)
ArrayOfNumbersplice in interface ArrayOfNumberpublic void unshift(double value)
ArrayOfNumberunshift in interface ArrayOfNumbervalue - the value to the storedCopyright © 2016. All rights reserved.