Jatha Software

org.jatha.dynatype
Class StandardLispBignum

java.lang.Object
  extended by org.jatha.dynatype.StandardLispValue
      extended by org.jatha.dynatype.StandardLispAtom
          extended by org.jatha.dynatype.StandardLispNumber
              extended by org.jatha.dynatype.StandardLispInteger
                  extended by org.jatha.dynatype.StandardLispBignum
All Implemented Interfaces:
Comparable, LispAtom, LispBignum, LispInteger, LispNumber, LispValue

public class StandardLispBignum
extends StandardLispInteger
implements LispBignum

Implements BigNums - large integers.


Field Summary
private  BigInteger value
           
 
Fields inherited from class org.jatha.dynatype.StandardLispValue
f_lisp
 
Fields inherited from interface org.jatha.dynatype.LispBignum
MAXINT, MININT, ZERO
 
Constructor Summary
StandardLispBignum()
           
StandardLispBignum(Jatha lisp)
           
StandardLispBignum(Jatha lisp, BigInteger theValue)
           
StandardLispBignum(Jatha lisp, double theValue)
           
StandardLispBignum(Jatha lisp, long theValue)
           
 
Method Summary
 LispValue abs()
          Bignum implementation of abs.
 LispValue add(LispValue args)
          ADD adds any combination of real or integer numbers.
 boolean basic_bignump()
          Returns Java true if the object is a Bignum.
 boolean basic_integerp()
          Returns Java true if the object is an integer.
 LispValue bignump()
          Returns T if the object is a Bignum.
 LispValue divide(LispValue args)
          DIVIDE adds any combination of real or integer numbers.
 LispValue eql(LispValue val)
          Returns T if the argument is EQ to the object or if the arguments and object are numbers with equal values.
 LispValue equal(LispValue val)
          Returns T if the argument is EQL or if two strings are STRING= or if two trees have EQUAL subtrees.
 BigInteger getBigIntegerValue()
           
 double getDoubleValue()
          Returns a double value corresponding to this value.
 long getLongValue()
           
 LispValue integerp()
          Returns T if the object is an Integer.
 void internal_prin1(PrintStream os)
           
 void internal_princ(PrintStream os)
           
 void internal_print(PrintStream os)
           
 LispValue multiply(LispValue args)
          MULTIPLY adds any combination of real or integer numbers.
 LispValue negate()
          Returns the negative of the given number.
 LispValue subtract(LispValue args)
          SUBTRACT adds any combination of real or integer numbers.
 Object toJava(String typeHint)
          Returns a Java Double, Float or Integer object, depending on the typeHint.
 String toString()
          toString() returns a printed representation of the form (as printed by (prin1)) in a Java string.
 LispValue type_of()
           
 LispValue typep(LispValue type)
           
 LispValue zerop()
           
 
Methods inherited from class org.jatha.dynatype.StandardLispInteger
getValue, toJava
 
Methods inherited from class org.jatha.dynatype.StandardLispNumber
acos, asin, atan, atan2, basic_constantp, basic_numberp, ceiling, constantp, cos, cot, csc, degreesToRadians, equalNumeric, factorial, floor, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, max, min, numberp, radiansToDegrees, reciprocal, sec, sin, sqrt, tan
 
Methods inherited from class org.jatha.dynatype.StandardLispAtom
atom, basic_atom
 
Methods inherited from class org.jatha.dynatype.StandardLispValue
adjustSpecialCount, append, apply, apropos_print, assoc, basic_consp, basic_floatp, basic_foreignp, basic_functionp, basic_keywordp, basic_length, basic_listp, basic_macrop, basic_null, basic_stringp, basic_symbolp, boundp, butlast, car, cdr, characterp, clrhash, compareTo, concatenate, consp, contains, copy_list, copy, documentation, eighth, elt, elt, eq, fboundp, fifth, first, floatp, fourth, funcall, functionp, get_specialCount, gethash, gethash, getLisp, hash_table_count, hash_table_rehash_size, hash_table_rehash_threshold, hash_table_size, hash_table_test, hashtablep, internal_getName, internal_prin1_as_cdr, internal_princ_as_cdr, internal_print_as_cdr, iterator, keywordp, last, length, lisp_null, list, listp, member, nconc, neql, ninth, nreverse, nstringCapitalize, nstringDowncase, nstringUpcase, pop, position, prin1, princ, print, push, rassoc, readFromString, remhash, remove, rest, reverse, rplaca, rplacd, second, set_special, setf_documentation, setf_gethash, setf_symbol_function, setf_symbol_plist, setf_symbol_value, setLisp, setPackage, setq, seventh, showStackTrace, sixth, specialP, string, stringCapitalize, stringDowncase, stringEndsWith, stringEq, stringEqual, stringGreaterP, stringGreaterThan, stringGreaterThanOrEqual, stringLeftTrim, stringLeftTrim, stringLessP, stringLessThan, stringLessThanOrEqual, stringNeq, stringNotGreaterP, stringNotLessP, stringp, stringRightTrim, stringRightTrim, stringStartsWith, stringTrim, stringTrim, stringUpcase, subst, substring, substring, symbol_function, symbol_name, symbol_package, symbol_plist, symbol_value, symbolp, tenth, third, toCollection, toString, toStringAsCdr_internal, toStringAsCdr, toStringShort, toStringShort, toStringSimple, uses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jatha.dynatype.LispValue
acos, adjustSpecialCount, append, apply, apropos_print, asin, assoc, atan, atan2, atom, basic_atom, basic_consp, basic_constantp, basic_floatp, basic_foreignp, basic_functionp, basic_keywordp, basic_length, basic_listp, basic_macrop, basic_null, basic_numberp, basic_stringp, basic_symbolp, boundp, butlast, car, cdr, ceiling, characterp, clrhash, compareTo, concatenate, consp, constantp, contains, copy_list, copy, cos, cot, csc, degreesToRadians, documentation, eighth, elt, elt, eq, equalNumeric, factorial, fboundp, fifth, first, floatp, floor, fourth, funcall, functionp, get_specialCount, gethash, gethash, getLisp, greaterThan, greaterThanOrEqual, hash_table_count, hash_table_rehash_size, hash_table_rehash_threshold, hash_table_size, hash_table_test, hashtablep, internal_getName, internal_prin1_as_cdr, internal_princ_as_cdr, internal_print_as_cdr, iterator, keywordp, last, length, lessThan, lessThanOrEqual, lisp_null, list, listp, max, member, min, nconc, neql, ninth, nreverse, nstringCapitalize, nstringDowncase, nstringUpcase, numberp, pop, position, prin1, princ, print, push, radiansToDegrees, rassoc, readFromString, reciprocal, remhash, remove, rest, reverse, rplaca, rplacd, sec, second, set_special, setf_documentation, setf_gethash, setf_symbol_function, setf_symbol_plist, setf_symbol_value, setLisp, setPackage, setq, seventh, sin, sixth, specialP, sqrt, string, stringCapitalize, stringDowncase, stringEndsWith, stringEq, stringEqual, stringGreaterP, stringGreaterThan, stringGreaterThanOrEqual, stringLeftTrim, stringLeftTrim, stringLessP, stringLessThan, stringLessThanOrEqual, stringNeq, stringNotGreaterP, stringNotLessP, stringp, stringRightTrim, stringRightTrim, stringStartsWith, stringTrim, stringTrim, stringUpcase, subst, substring, substring, symbol_function, symbol_name, symbol_package, symbol_plist, symbol_value, symbolp, tan, tenth, third, toCollection, toJava, toString, toStringAsCdr_internal, toStringAsCdr, toStringShort, toStringShort, toStringSimple, uses
 

Field Detail

value

private BigInteger value
Constructor Detail

StandardLispBignum

public StandardLispBignum()

StandardLispBignum

public StandardLispBignum(Jatha lisp,
                          BigInteger theValue)

StandardLispBignum

public StandardLispBignum(Jatha lisp,
                          long theValue)

StandardLispBignum

public StandardLispBignum(Jatha lisp,
                          double theValue)

StandardLispBignum

public StandardLispBignum(Jatha lisp)
Method Detail

getDoubleValue

public double getDoubleValue()
Description copied from interface: LispNumber
Returns a double value corresponding to this value.

Specified by:
getDoubleValue in interface LispNumber
Overrides:
getDoubleValue in class StandardLispInteger

getBigIntegerValue

public BigInteger getBigIntegerValue()
Specified by:
getBigIntegerValue in interface LispNumber
Overrides:
getBigIntegerValue in class StandardLispInteger

getLongValue

public long getLongValue()
Specified by:
getLongValue in interface LispNumber
Overrides:
getLongValue in class StandardLispInteger

internal_princ

public void internal_princ(PrintStream os)
Specified by:
internal_princ in interface LispValue
Overrides:
internal_princ in class StandardLispInteger

internal_prin1

public void internal_prin1(PrintStream os)
Specified by:
internal_prin1 in interface LispValue
Overrides:
internal_prin1 in class StandardLispInteger

internal_print

public void internal_print(PrintStream os)
Specified by:
internal_print in interface LispValue
Overrides:
internal_print in class StandardLispInteger

basic_bignump

public boolean basic_bignump()
Description copied from interface: LispValue
Returns Java true if the object is a Bignum.

Specified by:
basic_bignump in interface LispValue
Overrides:
basic_bignump in class StandardLispValue

basic_integerp

public boolean basic_integerp()
Description copied from interface: LispValue
Returns Java true if the object is an integer.

Specified by:
basic_integerp in interface LispValue
Overrides:
basic_integerp in class StandardLispInteger

toJava

public Object toJava(String typeHint)
Returns a Java Double, Float or Integer object, depending on the typeHint.

Specified by:
toJava in interface LispValue
Overrides:
toJava in class StandardLispInteger

toString

public String toString()
Description copied from class: StandardLispValue
toString() returns a printed representation of the form (as printed by (prin1)) in a Java string.

Specified by:
toString in interface LispValue
Overrides:
toString in class StandardLispInteger
Returns:
String The value in a string.

abs

public LispValue abs()
Bignum implementation of abs.

Specified by:
abs in interface LispValue
Overrides:
abs in class StandardLispInteger

eql

public LispValue eql(LispValue val)
Description copied from interface: LispValue
Returns T if the argument is EQ to the object or if the arguments and object are numbers with equal values.

Specified by:
eql in interface LispValue
Overrides:
eql in class StandardLispInteger

equal

public LispValue equal(LispValue val)
Description copied from interface: LispValue
Returns T if the argument is EQL or if two strings are STRING= or if two trees have EQUAL subtrees.

Specified by:
equal in interface LispValue
Overrides:
equal in class StandardLispInteger

add

public LispValue add(LispValue args)
Description copied from class: StandardLispNumber
ADD adds any combination of real or integer numbers. May create a Bignum or signal floating-point overflow if necessary.

Specified by:
add in interface LispValue
Overrides:
add in class StandardLispNumber
See Also:
LispReal, LispInteger

divide

public LispValue divide(LispValue args)
DIVIDE adds any combination of real or integer numbers.

Specified by:
divide in interface LispValue
Overrides:
divide in class StandardLispNumber
See Also:
LispReal, LispInteger

multiply

public LispValue multiply(LispValue args)
MULTIPLY adds any combination of real or integer numbers.

Specified by:
multiply in interface LispValue
Overrides:
multiply in class StandardLispNumber
See Also:
LispReal, LispInteger

subtract

public LispValue subtract(LispValue args)
SUBTRACT adds any combination of real or integer numbers.

Specified by:
subtract in interface LispValue
Overrides:
subtract in class StandardLispNumber
See Also:
LispReal, LispInteger

bignump

public LispValue bignump()
Description copied from interface: LispValue
Returns T if the object is a Bignum.

Specified by:
bignump in interface LispValue
Overrides:
bignump in class StandardLispValue

integerp

public LispValue integerp()
Description copied from interface: LispValue
Returns T if the object is an Integer.

Specified by:
integerp in interface LispValue
Overrides:
integerp in class StandardLispInteger

negate

public LispValue negate()
Description copied from class: StandardLispNumber
Returns the negative of the given number.

Specified by:
negate in interface LispValue
Overrides:
negate in class StandardLispNumber

type_of

public LispValue type_of()
Specified by:
type_of in interface LispValue
Overrides:
type_of in class StandardLispInteger

typep

public LispValue typep(LispValue type)
Specified by:
typep in interface LispValue
Overrides:
typep in class StandardLispInteger

zerop

public LispValue zerop()
Specified by:
zerop in interface LispValue
Overrides:
zerop in class StandardLispInteger

Jatha Software