MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.datamodel
Class MXQueryFloat

java.lang.Object
  extended by ch.ethz.mxquery.datamodel.MXQueryFloat
All Implemented Interfaces:
MXQueryNumber

public class MXQueryFloat
extends java.lang.Object
implements MXQueryNumber


Field Summary
static java.lang.String VALUE_NAN
           
static java.lang.String VALUE_NEG_INFINITY
           
static java.lang.String VALUE_POS_INFINITY
           
 
Constructor Summary
MXQueryFloat(float f)
           
MXQueryFloat(int i)
           
MXQueryFloat(int i1, int i2)
          MXQueryDouble created by dividing 2 integers
MXQueryFloat(long l1, long l2)
          MXQueryDouble created by dividing 2 longs
MXQueryFloat(java.lang.String s)
          Constructors:
 
Method Summary
 MXQueryNumber add(long l)
           
 MXQueryNumber add(MXQueryNumber d)
           
 int compareTo(long l)
           
 int compareTo(MXQueryNumber d)
           
 MXQueryNumber divide(long l)
           
 MXQueryNumber divide(MXQueryNumber d)
           
 boolean equals(MXQueryNumber d)
           
 boolean equalsZero()
          Methods:
 MXQueryDouble getDoubleValue()
           
 MXQueryFloat getFloatValue()
           
 int getIntValue()
           
 long getLongValue()
           
 int getType()
           
 double getValue()
           
 boolean hasFractionPart()
           
 long idiv(long i)
           
 long idiv(MXQueryNumber d)
           
 boolean isNaN()
           
 boolean isNegativeInfinity()
           
 boolean isPositiveInfinity()
           
 MXQueryNumber mod(long l)
           
 MXQueryNumber mod(MXQueryNumber d)
           
 MXQueryNumber multiply(long l)
           
 MXQueryNumber multiply(MXQueryNumber d)
           
 MXQueryNumber negate()
           
 MXQueryFloat round()
           
 MXQueryNumber subtract(long l)
           
 MXQueryNumber subtract(MXQueryNumber d)
           
 java.lang.String toDecimalString()
           
 java.lang.String toFormatString(int digit)
           
 java.lang.String toString()
           
static java.lang.String toString(float val, java.lang.String javaStrValue, boolean isNegativeZero)
          Conversion of a float to a string
 java.lang.String toTypedString(boolean isFloat)
           
 boolean unequals(MXQueryNumber d)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE_NAN

public static final java.lang.String VALUE_NAN
See Also:
Constant Field Values

VALUE_POS_INFINITY

public static final java.lang.String VALUE_POS_INFINITY
See Also:
Constant Field Values

VALUE_NEG_INFINITY

public static final java.lang.String VALUE_NEG_INFINITY
See Also:
Constant Field Values
Constructor Detail

MXQueryFloat

public MXQueryFloat(java.lang.String s)
             throws MXQueryException
Constructors:

Throws:
MXQueryException

MXQueryFloat

public MXQueryFloat(int i)

MXQueryFloat

public MXQueryFloat(int i1,
                    int i2)
MXQueryDouble created by dividing 2 integers

Parameters:
i1 - tobe divided
i2 - divider

MXQueryFloat

public MXQueryFloat(long l1,
                    long l2)
MXQueryDouble created by dividing 2 longs

Parameters:
l1 - to be divided
l2 - divider

MXQueryFloat

public MXQueryFloat(float f)
Method Detail

equalsZero

public boolean equalsZero()
Methods:

Specified by:
equalsZero in interface MXQueryNumber

add

public MXQueryNumber add(MXQueryNumber d)
Specified by:
add in interface MXQueryNumber

add

public MXQueryNumber add(long l)
Specified by:
add in interface MXQueryNumber

subtract

public MXQueryNumber subtract(MXQueryNumber d)
Specified by:
subtract in interface MXQueryNumber

subtract

public MXQueryNumber subtract(long l)
Specified by:
subtract in interface MXQueryNumber

multiply

public MXQueryNumber multiply(MXQueryNumber d)
Specified by:
multiply in interface MXQueryNumber

multiply

public MXQueryNumber multiply(long l)
Specified by:
multiply in interface MXQueryNumber

divide

public MXQueryNumber divide(MXQueryNumber d)
Specified by:
divide in interface MXQueryNumber

divide

public MXQueryNumber divide(long l)
Specified by:
divide in interface MXQueryNumber

mod

public MXQueryNumber mod(MXQueryNumber d)
Specified by:
mod in interface MXQueryNumber

mod

public MXQueryNumber mod(long l)
Specified by:
mod in interface MXQueryNumber

idiv

public long idiv(MXQueryNumber d)
          throws MXQueryException
Specified by:
idiv in interface MXQueryNumber
Throws:
MXQueryException

idiv

public long idiv(long i)
          throws MXQueryException
Specified by:
idiv in interface MXQueryNumber
Throws:
MXQueryException

isNaN

public boolean isNaN()
Specified by:
isNaN in interface MXQueryNumber

isNegativeInfinity

public boolean isNegativeInfinity()
Specified by:
isNegativeInfinity in interface MXQueryNumber

isPositiveInfinity

public boolean isPositiveInfinity()
Specified by:
isPositiveInfinity in interface MXQueryNumber

hasFractionPart

public boolean hasFractionPart()

equals

public boolean equals(MXQueryNumber d)
Specified by:
equals in interface MXQueryNumber

unequals

public boolean unequals(MXQueryNumber d)
Specified by:
unequals in interface MXQueryNumber

compareTo

public int compareTo(MXQueryNumber d)
Specified by:
compareTo in interface MXQueryNumber

compareTo

public int compareTo(long l)
Specified by:
compareTo in interface MXQueryNumber

negate

public MXQueryNumber negate()
Specified by:
negate in interface MXQueryNumber

getValue

public double getValue()

getIntValue

public int getIntValue()
                throws MXQueryException
Throws:
MXQueryException

getLongValue

public long getLongValue()
                  throws MXQueryException
Specified by:
getLongValue in interface MXQueryNumber
Throws:
MXQueryException

round

public MXQueryFloat round()
                   throws MXQueryException
Throws:
MXQueryException

toString

public static java.lang.String toString(float val,
                                        java.lang.String javaStrValue,
                                        boolean isNegativeZero)
Conversion of a float to a string

Parameters:
val - the actual double value
javaStrValue - the double value converted to string using the Java conventions. This value is adjusted as necessary to cater for the differences between the Java and XPath rules.
isNegativeZero -
Returns:
the value converted to a string, according to the XPath casting rules.

toString

public java.lang.String toString()
Specified by:
toString in interface MXQueryNumber
Overrides:
toString in class java.lang.Object

toTypedString

public java.lang.String toTypedString(boolean isFloat)

toFormatString

public java.lang.String toFormatString(int digit)

toDecimalString

public java.lang.String toDecimalString()
Specified by:
toDecimalString in interface MXQueryNumber

getType

public int getType()
Specified by:
getType in interface MXQueryNumber

getDoubleValue

public MXQueryDouble getDoubleValue()
Specified by:
getDoubleValue in interface MXQueryNumber

getFloatValue

public MXQueryFloat getFloatValue()
Specified by:
getFloatValue in interface MXQueryNumber

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich