org.abora.white.value
Class PrimIntegerSpec

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.value.PrimSpec
              |
              +--org.abora.white.value.PrimIntegerSpec

public class PrimIntegerSpec
extends PrimSpec


Field Summary
protected  boolean amSigned
           
protected  int myBitCount
           
protected  IntegerValue myMax
           
protected  IntegerValue myMin
           
static int UNLIMITED_BITS
           
 
Fields inherited from class org.abora.white.value.PrimSpec
arrayClass
 
Constructor Summary
protected PrimIntegerSpec(java.lang.Class arrayClass, int bitCount, boolean isSigned)
          Construct a new specification for integer values.
 
Method Summary
 int actualHashForEqual()
          Defined by subclasses to produce the value returned by hashForEqual.
 PrimArray arrayFromBuffer(java.lang.Object buffer)
          Make an array with the values at the given address
 int bitCount()
          How many bits, or zero if it is unlimited
 boolean canHold(IntegerValue value)
          Return true if this specification can hold the given value.
 PrimIntegerSpec combine(PrimIntegerSpec other)
          Return a specification whose range of values contains the ranges of both this and other.
 boolean isEqual(Heaper other)
          Return true if the two objects are equal.
 boolean isSigned()
          Return true if this specifications values may be negative.
 PrimArray privateCopy(PrimArray array, int size, int start, int count, int offset)
          Make a copy of an array with a different representation size.
 PrimIntegerArray string(java.lang.String string)
          Make an array the contents of the string
 IntegerValue value(int number)
          A boxed integer value
 
Methods inherited from class org.abora.white.value.PrimSpec
array, array, arrayClass, arrayWith, arrayWithThree, arrayWithTwo, copy, copy, copy, copy, copy, copyGrow, iEEE, iEEE32, iEEE64, int16, int32, int64, int8, integerVar, pointer, sharedPointer, signedInteger, toHold, uInt16, uInt32, uInt8, unsignedInteger
 
Methods inherited from class org.abora.white.xpp.basic.Heaper
destroy, destruct, equals, hashForEqual, printContentsOn, printOn, sendSelfTo, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myBitCount

protected int myBitCount

amSigned

protected boolean amSigned

myMin

protected IntegerValue myMin

myMax

protected IntegerValue myMax

UNLIMITED_BITS

public static final int UNLIMITED_BITS
See Also:
Constant Field Values
Constructor Detail

PrimIntegerSpec

protected PrimIntegerSpec(java.lang.Class arrayClass,
                          int bitCount,
                          boolean isSigned)
Construct a new specification for integer values.

Parameters:
arrayClass - the type of PrimArray used to hold values that meet this specification
bitCount -
isSigned - true if values can be negative and positive
Method Detail

bitCount

public int bitCount()
How many bits, or zero if it is unlimited


isSigned

public boolean isSigned()
Return true if this specifications values may be negative.

Returns:
true if this specifications values may be negative.

combine

public PrimIntegerSpec combine(PrimIntegerSpec other)
Return a specification whose range of values contains the ranges of both this and other.

Parameters:
other - other range of values to contain

actualHashForEqual

public int actualHashForEqual()
Description copied from class: Heaper
Defined by subclasses to produce the value returned by hashForEqual.

Overrides:
actualHashForEqual in class PrimSpec

canHold

public boolean canHold(IntegerValue value)
Return true if this specification can hold the given value.

Parameters:
value - integer value to test against.
Returns:
true if this specification can hold the given value.

isEqual

public boolean isEqual(Heaper other)
Description copied from class: Heaper
Return true if the two objects are equal.

Specified by:
isEqual in class Heaper

arrayFromBuffer

public PrimArray arrayFromBuffer(java.lang.Object buffer)
Make an array with the values at the given address

Specified by:
arrayFromBuffer in class PrimSpec
Parameters:
buffer - Java array containing elements meeting this specification.
Returns:
the array

string

public PrimIntegerArray string(java.lang.String string)
                        throws java.io.UnsupportedEncodingException
Make an array the contents of the string

java.io.UnsupportedEncodingException

value

public IntegerValue value(int number)
A boxed integer value


privateCopy

public PrimArray privateCopy(PrimArray array,
                             int size,
                             int start,
                             int count,
                             int offset)
Make a copy of an array with a different representation size. The arguments are the same as in PrimArray::copy.

Specified by:
privateCopy in class PrimSpec


Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.