Orbital library

orbital.math
Interface Integer

All Superinterfaces:
Arithmetic, java.lang.Comparable, Complex, Euclidean, Normed, Rational, Real, Scalar

public interface Integer
extends Rational, Euclidean

Representation of an integer number k∈Z.

Integer numbers are a subgroup of Q for '+', it is embedded in Q for the field operation '*'. Integers are the group of differences of N.

On the importance of Quotient<Integer>: all cyclic groups are Z/nZ with n∈Z. All finitely generated Abelian groups are direct sums of cyclic groups, hence Vector<Quotient<Integer>>

Author:
André Platzer
See Also:
ValueFactory.valueOf(int), ValueFactory.valueOf(long), ValueFactory.valueOf(short), ValueFactory.valueOf(byte), ValueFactory.valueOf(java.math.BigInteger)
Structure:
specializes Rational (needs covariant parameters and covariant results) Since integers are a special case of integers, and thus only adding integers to integers will make sense - on the first sight - but not adding rationals. In order to achieve that integers behave like rationals they additionally have a subtype relation., subtypeOf Rational (needs contravariant parameters and covariant result) In order to realize ZQ we embed ZQ, implemented with multiple argument dynamic dispatch.
Stereotype:
data-type

Field Summary
static Predicate hasType
          Checks whether the given number is in the set of integers and not a subset.
static Predicate isa
          Checks whether the given number is in the set of integers.
 
Fields inherited from interface orbital.math.Arithmetic
numerical
 
Method Summary
 Integer add(Integer b)
           
 byte byteValue()
          Returns the value of the specified integer as a byte.
 int intValue()
          Returns the value of the specified integer as a int.
 long longValue()
          Returns the value of the specified integer as a long.
 Integer multiply(Integer b)
           
 Rational power(Integer b)
          Return ab.
 short shortValue()
          Returns the value of the specified integer as a short.
 Integer subtract(Integer b)
           
 
Methods inherited from interface orbital.math.Rational
add, denominator, divide, multiply, numerator, power, representative, subtract
 
Methods inherited from interface orbital.math.Real
add, compareTo, divide, doubleValue, floatValue, multiply, power, subtract
 
Methods inherited from interface orbital.math.Complex
add, arg, conjugate, divide, equals, hashCode, im, isInfinite, isNaN, multiply, norm, power, re, subtract
 
Methods inherited from interface orbital.math.Arithmetic
add, divide, equals, inverse, isOne, isZero, minus, multiply, one, power, scale, subtract, toString, valueFactory, zero
 
Methods inherited from interface orbital.math.Euclidean
degree, modulo, quotient
 

Field Detail

isa

static final Predicate isa
Checks whether the given number is in the set of integers. return whether v is an integer.


hasType

static final Predicate hasType
Checks whether the given number is in the set of integers and not a subset. return whether v∈Z is an integer.

Method Detail

byteValue

byte byteValue()
Returns the value of the specified integer as a byte. This may involve rounding or truncation. Similar to the standard narrowing primitive conversion as defined in The Java Language Specification: if this integer is too big to fit in an int, only the low-order bits are returned.

Returns:
the numeric value represented by this object after conversion to type byte.

shortValue

short shortValue()
Returns the value of the specified integer as a short. This may involve rounding or truncation. Similar to the standard narrowing primitive conversion as defined in The Java Language Specification: if this integer is too big to fit in an int, only the low-order bits are returned.

Returns:
the numeric value represented by this object after conversion to type short.

intValue

int intValue()
Returns the value of the specified integer as a int. This may involve rounding or truncation. Similar to the standard narrowing primitive conversion as defined in The Java Language Specification: if this integer is too big to fit in an int, only the low-order bits are returned.

Returns:
the numeric value represented by this object after conversion to type int.

longValue

long longValue()
Returns the value of the specified integer as a long. This may involve rounding or truncation. Similar to the standard narrowing primitive conversion as defined in The Java Language Specification: if this integer is too big to fit in an int, only the low-order bits are returned.

Returns:
the numeric value represented by this object after conversion to type long.

add

Integer add(Integer b)

subtract

Integer subtract(Integer b)

multiply

Integer multiply(Integer b)

power

Rational power(Integer b)
Return ab.

Specified by:
power in interface Rational
Postconditions:
(b > 0 → RES instanceof Integer) ∧ (b < 0 → RES instanceof Rational)

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.