|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
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.PrimFloatArray
Fixed size array containing floating point numbers of the same precision.
The double primitive type is assumed to have the greatest
precision stored by all subclass implementations and so is used to implement
general floating-point implementations. Subclasses should reimplement operations for
performance or where their specific element type has to be reflected in the
API.
You should be aware that the methods defined at this level will often convert
array element values into double primitive type before operating
on the value. Sometimes when converting from float to double values values can
subtely change. This may manifest in operations such as comparison producing
unexpected results.
| Constructor Summary | |
protected |
PrimFloatArray()
Construct a new array. |
| 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. |
abstract 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. |
int |
elementsHash(int count,
int start)
A hash of the range of values out of the array. |
abstract double |
floatAt(int index)
Return the floating point number at the specified index. |
int |
indexOf(Heaper value,
int start,
int nth)
Return the index of the nth occurrence of the given value at or after (before if nth is negative) the given index, or -1 if there is none. |
int |
indexPast(Heaper value,
int start,
int nth)
Return the index of the nth occurrence of anything but the given value at or after (before if nth is negative) the given index, or -1 if there is none. |
abstract void |
storeFloat(int index,
double value)
Store a floating point number at the specified index. |
protected void |
subtractData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
Subtract the respective elements of other from this over the given index range. |
protected Heaper |
zeroElement()
Return a suitable immutable zero element for this type of array; either 0 or null. |
| Methods inherited from class org.abora.white.collection.arrays.PrimArithmeticArray |
addElements, addElements, addElements, compare, compare, compare, compare, contentsEqual, elementsEqual, signOfNonZeroAfter, subtractElements, subtractElements, subtractElements |
| Methods inherited from class org.abora.white.collection.arrays.PrimArray |
contentsHash, copy, copy, copy, copy, copy, copyElements, copyGrow, count, elementsEqual, elementsEqual, elementsHash, elementsHash, fetchValue, getValue, indexOf, indexOf, indexOfElements, indexOfElements, indexOfElements, indexOfElements, indexOfElements, indexPast, indexPast, isEqual, makeNew, printElementOn, printOn, spec, storeAll, storeAll, storeAll, storeMany, storeMany, storeMany, storeValue, zeroElements, zeroElements, zeroElements |
| Methods inherited from class org.abora.white.xpp.basic.Heaper |
actualHashForEqual, destroy, destruct, equals, hashForEqual, printContentsOn, sendSelfTo, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected PrimFloatArray()
Restrict public access to constructor; use suitable static factory method instead.
| Method Detail |
public abstract void storeFloat(int index,
double value)
index.
index - 0 based index to store the value at.value - value to store in array, may lose precision if
array cant hold the full extent of it.public abstract double floatAt(int index)
index.
index - 0 based index of this to read the number from.
public abstract int bitCount()
public int elementsHash(int count,
int start)
PrimArray
elementsHash in class PrimArray
protected int compareData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
PrimArithmeticArray
compareData in class PrimArithmeticArray
public int indexOf(Heaper value,
int start,
int nth)
PrimArray
indexOf in class PrimArrayvalue - element that is to be matchedstart - index to start the search. If positive start from that index,
if negative start from relatie to end of array
public int indexPast(Heaper value,
int start,
int nth)
PrimArray
indexPast in class PrimArrayvalue - anything except this element that is to be matchedstart - index to start the search. If positive start from that index,
if negative start from relatie to end of array
protected Heaper zeroElement()
PrimArray
zeroElement in class PrimArray
protected void addData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
PrimArithmeticArrayNote that arithmetic overflows aren't faulted.
Subclasses should override.
addData in class PrimArithmeticArray
protected void subtractData(int start,
PrimArithmeticArray other,
int otherStart,
int count)
PrimArithmeticArrayNote that arithmetic overflows aren't faulted.
Subclasses should override.
subtractData in class PrimArithmeticArray
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||