|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.DoubleArray
com.quinncurtis.chart2djava.TimeArray
public class TimeArray
The TimeArray is an improved version of the standard Array type because it allows automatic and dynamic resizing of the array. The array has a Length property that specifies the number of elements in the array, and a maxCapacity property that specifies the size of the internal Array buffer. The internal buffer can be sized much larger than the Length property, allowing the array to grow in length without forcing a time consuming reallocation and the subsequent copying of all of the data values. Not really important if you are dealing with 10 or 20 element arrays, but very important if you have 1,000,000 element arrays.
Constructor Summary | |
---|---|
TimeArray()
Default constructor. |
|
TimeArray(java.util.GregorianCalendar[] x)
Constructor initializes the array using the specified data values. |
|
TimeArray(java.util.GregorianCalendar[] x,
int maxcap)
Constructor initializes the array using the specified data values. |
|
TimeArray(int n)
Constructor creates an array of Length n, initialized to zero. |
Method Summary | |
---|---|
int |
add(java.util.GregorianCalendar r)
Adds a new element at the end of the array, increasing the length of the array by one. |
int |
addRange(java.util.GregorianCalendar[] x)
Adds a array of new values at the end of the array, increasing the length of the array by the length of the source array. |
static void |
arrayCopy(java.util.GregorianCalendar[] source,
int sourceoffset,
double[] dest,
int destoffset,
int count)
|
java.lang.Object |
clone()
Returns an object that is a clone of this array object. |
void |
copy(TimeArray source)
Copies the source array to the current instance. |
java.util.GregorianCalendar[] |
getTimeDataBuffer()
Returns a reference to the Array object that represents internal data buffer. |
java.util.GregorianCalendar |
getTimeElement(int index)
Get the value of a single element in the array. |
java.util.GregorianCalendar[] |
getTimeElements()
Returns a copy of the data values in the array sized to the number of elements. |
void |
setElement(int index,
java.util.GregorianCalendar r)
Set the value of a single element in the array. |
int |
setElements(java.util.GregorianCalendar[] source)
Initializes the elements of the array, starting at element 0. |
int |
setElements(java.util.GregorianCalendar[] source,
int count)
Initializes the elements of the array, starting at element 0 and continuing for count elements. |
int |
setElements(TimeArray source)
Initializes the elements of the array, starting at element 0. |
int |
setElements(TimeArray source,
int count)
Initializes the elements of the array, starting at element 0 and continuing for count elements. |
java.util.GregorianCalendar[] |
TimeDataBuffer()
Returns a reference to the Array object that represents internal data buffer. |
Methods inherited from class com.quinncurtis.chart2djava.DoubleArray |
---|
add, addRange, arrayCopy, clear, copy, copyArray, DataBuffer, delete, getDataBuffer, getElement, getElements, insert, length, maxCapacity, nDCopy, removeAt, reset, resize, resizeCapacity, setElement, setElements, setElements, setElements, setElements, setLength, shiftLeft, shiftLeftThenResize, shiftRight, TrimToSize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeArray()
public TimeArray(java.util.GregorianCalendar[] x)
x
- The initializing data values.public TimeArray(java.util.GregorianCalendar[] x, int maxcap)
x
- The initializing data values.maxcap
- The internal buffer holding the data values is sized to the value of maxcap.
If the number of data values exceeds the maxcap limit, the size of maxcap is automatically doubled.public TimeArray(int n)
n
- The array is sized to n elements.Method Detail |
---|
public int add(java.util.GregorianCalendar r)
r
- The new value to add at the end of the array.
public int addRange(java.util.GregorianCalendar[] x)
x
- An array of new values that are added to the end of the array.
public static void arrayCopy(java.util.GregorianCalendar[] source, int sourceoffset, double[] dest, int destoffset, int count)
public java.lang.Object clone()
clone
in class DoubleArray
public void copy(TimeArray source)
source
- The source array object.public java.util.GregorianCalendar[] getTimeDataBuffer()
public java.util.GregorianCalendar getTimeElement(int index)
index
- The array index.
public java.util.GregorianCalendar[] getTimeElements()
public void setElement(int index, java.util.GregorianCalendar r)
index
- The index to set in the array.r
- The array element at index is set to the value r.*public int setElements(java.util.GregorianCalendar[] source)
source
- An array of new values used to initialize the array. The
array will end up the same size as the source array.
public int setElements(java.util.GregorianCalendar[] source, int count)
source
- An array of new values used to initialize the array. The
array will end up the same size as the source array, or the count value, whichever is smaller.count
- Specifies the number of elements to initialize.
public int setElements(TimeArray source)
source
- An array of new values used to initialize the array. The
array will end up the same size as the source array.
public int setElements(TimeArray source, int count)
source
- An array of new values used to initialize the array. The
array will end up the same size as the source array, or the count value, whichever is smaller.count
- Specifies the number of elements to initialize.
public java.util.GregorianCalendar[] TimeDataBuffer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |