org.abora.white.collection.arrays
Class Int64Array
java.lang.Object
|
+--org.abora.white.xpp.basic.Heaper
|
+--org.abora.white.collection.arrays.PrimArray
|
+--org.abora.white.collection.arrays.PrimArithmeticArray
|
+--org.abora.white.collection.arrays.PrimIntegerArray
|
+--org.abora.white.collection.arrays.PrimIntArray
|
+--org.abora.white.collection.arrays.Int64Array
- public class Int64Array
- extends PrimIntArray
Concrete fixed size array that holds elements of the 16-bit signed integral type.
This maps to the Java short primitive type.
|
Method Summary |
protected void |
addData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
Arithmetic addition of the respective elements of other
to this over the specified index range. |
int |
bitCount()
Return the maximum bits/entry that can be stored in this array |
protected int |
compareData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
Over given range, returns - if this < other; 0 if this == other; + if
this > other. |
void |
copyToBuffer(long[] buffer,
int count,
int start)
Copy a consequitive range of elements from the receiver into the
supplied buffer. |
int |
count()
Return the number of elements the array can hold. |
Heaper |
fetchValue(int index)
Fetch a value; may be a Heaper, null, or a PrimValue as appropriate
to PrimArray subclass. |
long |
int64At(int index)
Get an 64 bit signed actual integer value |
IntegerValue |
integerAt(int index)
Fetch an integer value at the specified index. |
static Int64Array |
make(int count)
create an Int64Array filled with zeros |
static Int64Array |
make(int size,
PrimArray from)
|
static Int64Array |
make(int size,
PrimArray from,
int sourceOffset)
|
static Int64Array |
make(int size,
PrimArray from,
int sourceOffset,
int count)
|
static Int64Array |
make(int size,
PrimArray from,
int sourceOffset,
int count,
int destOffset)
create an Int64Array filled with the indicated data in 'from' |
static Int64Array |
make(long[] buffer)
create an Int64Array filled with the data at 'buffer' |
static Int64Array |
make(PrimArray from)
|
protected PrimArray |
makeNew(int size,
PrimArray source,
int sourceOffset,
int count,
int destOffset)
Return a new array of the same type as this
initialized with the elements of source specified by
the index range, prepended by destOffset and postpended by
null or 0 elements. |
protected void |
printElementOn(int index,
java.io.PrintWriter oo)
Print a representation of the element at the given index. |
protected int |
signOfNonZeroAfter(int index)
Return the sign, -1 or +1, of the next non-zero element after start, or 0 if no such
element. |
PrimSpec |
spec()
A description of the kinds of things which can be stored
in this array |
void |
storeInt64(int index,
long value)
Store an 64 bit signed integer value |
void |
storeInteger(int index,
IntegerValue value)
Store an integer value at the specified index. |
void |
storeValue(int index,
Heaper value)
Store a value; may be a Heaper, null, or a PrimValue as appropriate
to PrimArray subclass. |
protected void |
subtractData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
Subtract the respective elements of other from this over the given index
range. |
| Methods inherited from class org.abora.white.collection.arrays.PrimIntegerArray |
elementsHash, hold, hold, indexOf, indexOfInteger, indexOfInteger, indexOfInteger, indexPast, indexPastInteger, indexPastInteger, indexPastInteger, storeAll, zeroElement |
| Methods inherited from class org.abora.white.collection.arrays.PrimArithmeticArray |
addElements, addElements, addElements, compare, compare, compare, compare, contentsEqual, elementsEqual, subtractElements, subtractElements, subtractElements |
| Methods inherited from class org.abora.white.collection.arrays.PrimArray |
contentsHash, copy, copy, copy, copy, copy, copyElements, copyGrow, elementsEqual, elementsEqual, elementsHash, elementsHash, getValue, indexOf, indexOf, indexOfElements, indexOfElements, indexOfElements, indexOfElements, indexOfElements, indexPast, indexPast, isEqual, printOn, storeAll, storeAll, storeMany, storeMany, storeMany, zeroElements, zeroElements, zeroElements |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Int64Array
protected Int64Array(int count)
Int64Array
protected Int64Array(int size,
PrimArray from,
int sourceOffset,
int count,
int destOffset)
Int64Array
protected Int64Array(long[] buffer)
make
public static Int64Array make(int count)
- create an Int64Array filled with zeros
make
public static Int64Array make(int size,
PrimArray from,
int sourceOffset,
int count,
int destOffset)
- create an Int64Array filled with the indicated data in 'from'
make
public static Int64Array make(int size,
PrimArray from,
int sourceOffset,
int count)
make
public static Int64Array make(int size,
PrimArray from,
int sourceOffset)
make
public static Int64Array make(int size,
PrimArray from)
make
public static Int64Array make(PrimArray from)
make
public static Int64Array make(long[] buffer)
- create an Int64Array filled with the data at 'buffer'
makeNew
protected PrimArray makeNew(int size,
PrimArray source,
int sourceOffset,
int count,
int destOffset)
- Description copied from class:
PrimArray
- Return a new array of the same type as
this
initialized with the elements of source specified by
the index range, prepended by destOffset and postpended by
null or 0 elements.
- Specified by:
makeNew in class PrimArray
- Parameters:
size - size of new array.source - source of elements to be initialized with in the new array.sourceOffset - first index of the source array to be included in the range.count - number of elements of source to include in the new arraydestOffset - first index of new array to be initialized with source elements.
- Returns:
- the new array.
storeInt64
public void storeInt64(int index,
long value)
- Store an 64 bit signed integer value
int64At
public long int64At(int index)
- Get an 64 bit signed actual integer value
storeInteger
public void storeInteger(int index,
IntegerValue value)
- Description copied from class:
PrimIntegerArray
- Store an integer
value at the specified index.
- Specified by:
storeInteger in class PrimIntegerArray
- Parameters:
index - index in array the element will be stored at.value - integer to store in this.
integerAt
public IntegerValue integerAt(int index)
- Description copied from class:
PrimIntegerArray
- Fetch an integer value at the specified
index.
- Specified by:
integerAt in class PrimIntegerArray
- Parameters:
index - index in array whose element will be returned
- Returns:
- the integer at the specified
index.
storeValue
public void storeValue(int index,
Heaper value)
- Description copied from class:
PrimArray
- Store a value; may be a Heaper, null, or a PrimValue as appropriate
to PrimArray subclass. An exception will be throw if the value is
not compatible with the elements
this can hold.
It is expected that most PrimArray clients will want to use
less abstract access methods
- Specified by:
storeValue in class PrimArray
- Parameters:
index - index in array the element will be stored at.value - heaper to store in this.
fetchValue
public Heaper fetchValue(int index)
- Description copied from class:
PrimArray
- Fetch a value; may be a Heaper, null, or a PrimValue as appropriate
to PrimArray subclass.
It is expected that most PrimArray clients
will want to use less abstract access methods.
- Specified by:
fetchValue in class PrimArray
- Parameters:
index - index in array whose element will be returned
- Returns:
- the heaper at the specified
index.
count
public int count()
- Description copied from class:
PrimArray
- Return the number of elements the array can hold.
- Specified by:
count in class PrimArray
spec
public PrimSpec spec()
- Description copied from class:
PrimArray
- A description of the kinds of things which can be stored
in this array
- Specified by:
spec in class PrimArray
bitCount
public int bitCount()
- Description copied from class:
PrimIntArray
- Return the maximum bits/entry that can be stored in this array
- Specified by:
bitCount in class PrimIntArray
copyToBuffer
public void copyToBuffer(long[] buffer,
int count,
int start)
- Copy a consequitive range of elements from the receiver into the
supplied buffer.
- Parameters:
buffer - array to fill with receveirs elementscount - number of consequentive elements in range or all
elements from start if -1. Silently truncate if count is
larger than available elements in the receiverstart - index of first element in range
compareData
protected int compareData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
- Description copied from class:
PrimArithmeticArray
- Over given range, returns - if this < other; 0 if this == other; + if
this > other.
- Overrides:
compareData in class PrimIntegerArray
signOfNonZeroAfter
protected int signOfNonZeroAfter(int index)
- Description copied from class:
PrimArithmeticArray
- Return the sign, -1 or +1, of the next non-zero element after start, or 0 if no such
element. Note that for the unsigned arrays, this will only return 0 or
1.
- Specified by:
signOfNonZeroAfter in class PrimArithmeticArray
addData
protected void addData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
- Description copied from class:
PrimArithmeticArray
- Arithmetic addition of the respective elements of other
to this over the specified index range.
Note that arithmetic overflows aren't faulted.
Subclasses should override.
- Overrides:
addData in class PrimIntegerArray
subtractData
protected void subtractData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
- Description copied from class:
PrimArithmeticArray
- Subtract the respective elements of other from this over the given index
range.
Note that arithmetic overflows aren't faulted.
Subclasses should override.
- Overrides:
subtractData in class PrimIntegerArray
printElementOn
protected void printElementOn(int index,
java.io.PrintWriter oo)
- Description copied from class:
PrimArray
- Print a representation of the element at the given
index.
- Overrides:
printElementOn in class PrimArray
- Parameters:
index - index of element to be printed.oo - print stream to write element representation to.
Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.