org.abora.white.collection.arrays
Class IEEE64Array

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
                          |
                          +--org.abora.white.collection.arrays.IEEE64Array

public class IEEE64Array
extends PrimFloatArray

Concrete fixed size array that holds elements of the Java double floating-point primitive data type. This is conceptually associated with the double-precision 64-bit format IEEE 754 values.


Constructor Summary
protected IEEE64Array(double[] source)
          Construct a new array of the same size as the specified source and containing a copy of its content.
protected IEEE64Array(int count)
          Construct a new array of the specified size with all elements initialized to zero.
protected IEEE64Array(int size, PrimArray from, int sourceOffset, int count, int destOffset)
          Construct a new array of the specified size with all elements initialized to zero.
 
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.
protected  void copyElements(int to, PrimArray source, int from, int count)
          Copy the respective elements of other to this over the specified index range.
 void copyToBuffer(double[] buffer, int count, int start)
           
 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.
 double floatAt(int index)
          Return the floating point number at the specified index.
 double iEEE64At(int index)
          Get an actual floating point number
static IEEE64Array make(double[] buffer)
          create an IEEE64Array filled with the data at 'buffer'
static IEEE64Array make(int count)
          Return a new IEEE64Array of the specified size suitable for holding IEEE64 values, initially filled with zeros.
static IEEE64Array make(int size, PrimArray from)
           
static IEEE64Array make(int size, PrimArray from, int sourceOffset)
           
static IEEE64Array make(int size, PrimArray from, int sourceOffset, int count)
           
static IEEE64Array make(int size, PrimArray from, int sourceOffset, int count, int destOffset)
          create an IEEE64Array filled with the indicated data in 'from'
static IEEE64Array 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 start)
          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 storeAll(Heaper value, int count, int start)
          Fill a consequitive range of elements with the supplied value.
 void storeFloat(int index, double value)
          Store a floating point number at the specified index.
 void storeIEEE64(int index, double value)
          Store an actual floating point value
 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.PrimFloatArray
elementsHash, indexOf, indexPast, 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, 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 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

IEEE64Array

protected IEEE64Array(int count)
Construct a new array of the specified size with all elements initialized to zero. Restrict public access to constructor; use suitable static factory method instead.

Parameters:
count - size of array

IEEE64Array

protected IEEE64Array(int size,
                      PrimArray from,
                      int sourceOffset,
                      int count,
                      int destOffset)
Construct a new array of the specified size with all elements initialized to zero. Restrict public access to constructor; use suitable static factory method instead.

Parameters:
count - number of elements this will be able to hold

IEEE64Array

protected IEEE64Array(double[] source)
Construct a new array of the same size as the specified source and containing a copy of its content. Restrict public access to constructor; use suitable static factory method instead.

Parameters:
source - primitive array to copy
Method Detail

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 array
destOffset - first index of new array to be initialized with source elements.
Returns:
the new array.

make

public static IEEE64Array make(int count)
Return a new IEEE64Array of the specified size suitable for holding IEEE64 values, initially filled with zeros.

Parameters:
count - number of elements this will be able to hold

make

public static IEEE64Array make(int size,
                               PrimArray from,
                               int sourceOffset,
                               int count,
                               int destOffset)
create an IEEE64Array filled with the indicated data in 'from'


make

public static IEEE64Array make(int size,
                               PrimArray from,
                               int sourceOffset,
                               int count)

make

public static IEEE64Array make(int size,
                               PrimArray from,
                               int sourceOffset)

make

public static IEEE64Array make(int size,
                               PrimArray from)

make

public static IEEE64Array make(PrimArray from)

make

public static IEEE64Array make(double[] buffer)
create an IEEE64Array filled with the data at 'buffer'


storeIEEE64

public void storeIEEE64(int index,
                        double value)
Store an actual floating point value


iEEE64At

public double iEEE64At(int index)
Get an actual floating point number


storeFloat

public void storeFloat(int index,
                       double value)
Description copied from class: PrimFloatArray
Store a floating point number at the specified index.

Specified by:
storeFloat in class PrimFloatArray
Parameters:
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.

floatAt

public double floatAt(int index)
Description copied from class: PrimFloatArray
Return the floating point number at the specified index.

Specified by:
floatAt in class PrimFloatArray
Parameters:
index - 0 based index of this to read the number from.
Returns:
value 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: PrimFloatArray
Return the maximum bits/entry that can be stored in this array.

Specified by:
bitCount in class PrimFloatArray

storeAll

public void storeAll(Heaper value,
                     int count,
                     int start)
Description copied from class: PrimArray
Fill a consequitive range of elements with the supplied value.

Specified by:
storeAll in class PrimArray
Parameters:
value - to store within range or 0.0 if null.
count - number of consequentive elements in range or all elements from start if -1.
start - index of first element in range.

copyToBuffer

public void copyToBuffer(double[] buffer,
                         int count,
                         int start)

copyElements

protected void copyElements(int to,
                            PrimArray source,
                            int from,
                            int count)
Description copied from class: PrimArray
Copy the respective elements of other to this over the specified index range. The other array must be of a compatible type.

Overrides:
copyElements in class PrimArray
Parameters:
to - first index of receiver to be included in the receivers range..
source - other elements to be copied into this.
from - first index of the other array to be included in the range.
count - number of elements from the other array included in range, or -1 for all others elements starting at from. Fail if count is greater than number of available elements.

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 PrimFloatArray

signOfNonZeroAfter

protected int signOfNonZeroAfter(int start)
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 PrimFloatArray

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 PrimFloatArray

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.