org.gcube.data.analysis.tabulardata.model.datatype
Class NumericType

java.lang.Object
  extended by org.gcube.data.analysis.tabulardata.model.datatype.DataType
      extended by org.gcube.data.analysis.tabulardata.model.datatype.NumericType
All Implemented Interfaces:
Serializable

public class NumericType
extends DataType

The type numeric can store numbers with up to 1000 digits of precision and perform calculations exactly. A Numeric is defined with a precision and a scale. The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point. The precision of a numeric is the total count of significant digits in the whole number, that is, the number of digits to both sides of the decimal point.

Author:
"Luigi Fortunati"
See Also:
Serialized Form

Constructor Summary
NumericType()
          Define a Numeric type with default precision and scale
NumericType(int precision)
          Creates a Numeric type with a given precision
NumericType(int precision, int scale)
          Creates a Numeric type with a given precision and scale.
 
Method Summary
 boolean equals(Object obj)
           
 Integer getPrecision()
           
 Integer getScale()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericType

public NumericType()
Define a Numeric type with default precision and scale


NumericType

public NumericType(int precision)
Creates a Numeric type with a given precision

Parameters:
precision - total count of significant digits in the whole number

NumericType

public NumericType(int precision,
                   int scale)
Creates a Numeric type with a given precision and scale.

Parameters:
precision - total count of significant digits in the whole number
scale - count of decimal digits in the fractional part
Throws:
IllegalArgumentException
Method Detail

getPrecision

public Integer getPrecision()

getScale

public Integer getScale()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.