public final class IlvDoubleArray extends Object implements Serializable
double
primitives.Constructor and Description |
---|
IlvDoubleArray()
Creates a new
IlvDoubleArray object with no values. |
IlvDoubleArray(double[] array)
Creates a new
IlvDoubleArray object and initializes it with
the given values. |
IlvDoubleArray(int initialSize)
Creates a new
IlvDoubleArray object and allocates storage
for initialSize values. |
Modifier and Type | Method and Description |
---|---|
void |
add(double val)
Adds the specified value at the end of this array.
|
void |
add(double[] array)
Adds all the values of the specified array at the end of this array.
|
void |
add(double[] array,
int length)
Adds a part of the specified array at the end of this array.
|
void |
add(IlvDoubleArray array)
Adds all the values of the specified array at the end of this array.
|
void |
add(int insertIdx,
double[] array,
int length)
Inserts a part of the specified array into this array.
|
void |
clear()
Removes all the values from this array.
|
IlvDoubleArray |
copy()
Returns a copy of this array.
|
double[] |
data()
Returns the values stored in the array.
|
boolean |
equals(Object o)
Compares the specified object with this array for equality.
|
double |
get(int i)
Returns the value at the specified index.
|
void |
remove(int start,
int count)
Removes the specified values from this array.
|
void |
reset()
Resets the array size to
0 . |
void |
reverse()
Reverses the contents of this array.
|
void |
set(int i,
double value)
Sets the value at the specified index.
|
int |
size()
Returns the number of values stored in the array.
|
String |
toString()
Returns a string representation of this array.
|
void |
trim()
Trims the capacity of this array to be the current size of the array.
|
public IlvDoubleArray()
IlvDoubleArray
object with no values.public IlvDoubleArray(double[] array)
IlvDoubleArray
object and initializes it with
the given values.
Note: The specified array is not copied.
public IlvDoubleArray(int initialSize)
IlvDoubleArray
object and allocates storage
for initialSize
values.public void add(double val)
public void add(double[] array)
public void add(IlvDoubleArray array)
public void add(double[] array, int length)
0
to length
are added.array
- The source array containing the values to add.length
- The number of values to add.public void add(int insertIdx, double[] array, int length)
insertIdx
- The insertion index. This index must be less than or equal
to the number of values stored in this object.array
- The source array containing the values to insert.length
- The number of values to insert.public void trim()
public void remove(int start, int count)
start
- The index of the first value to remove.count
- The number of values to remove.public void clear()
public void reset()
0
.public int size()
public double[] data()
Note: The returned array is a direct reference to the internal array of the object.
public double get(int i)
public void set(int i, double value)
public void reverse()
public IlvDoubleArray copy()
public boolean equals(Object o)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.