Java Doc for NumberDataType.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » types » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.iapi.types 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.types.DataType
      org.apache.derby.iapi.types.NumberDataType

All known Subclasses:   org.apache.derby.iapi.types.SQLLongint,  org.apache.derby.iapi.types.SQLReal,  org.apache.derby.iapi.types.SQLTinyint,  org.apache.derby.iapi.types.SQLDouble,  org.apache.derby.iapi.types.SQLInteger,  org.apache.derby.iapi.types.BinaryDecimal,  org.apache.derby.iapi.types.SQLSmallint,  org.apache.derby.iapi.types.SQLDecimal,
NumberDataType
abstract public class NumberDataType extends DataType implements NumberDataValue(Code)
NumberDataType is the superclass for all exact and approximate numeric data types. It exists for the purpose of allowing classification of types for supported implicit conversions among them.
See Also:   DataType
author:
   ames


Field Summary
static  ComparableMAXLONG_PLUS_ONE
     Set by the booting DataValueFactory implementation.
static  ComparableMINLONG_MINUS_ONE
     Set by the booting DataValueFactory implementation.
static  DataValueDescriptorZERO_DECIMAL
     Set by the booting DataValueFactory implementation.


Method Summary
final public  NumberDataValueabsolute(NumberDataValue result)
     Numbers check for isNegative first and negate it if negative. this object's absolute value.
final public  intcompare(DataValueDescriptor arg)
    
final public  booleancompare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV)
    
public  NumberDataValuedivide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result)
     This method implements the / operator for TINYINT, SMALLINT and INTEGER.
public  NumberDataValuedivide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale)
     Suitable for integral types that ignore scale.
public  intgetDecimalValuePrecision()
     Return the precision of this specific DECIMAL value.
public  intgetDecimalValueScale()
     Return the scale of this specific DECIMAL value.
abstract protected  booleanisNegative()
     The isNegative abstract method.
public  NumberDataValueminus(NumberDataValue left, NumberDataValue right, NumberDataValue result)
     This method implements the - operator for TINYINT, SMALLINT and INTEGER.
public  NumberDataValuemod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result)
    
public static  doublenormalizeDOUBLE(double v)
     normalizeDOUBLE checks the validity of the given java double that it fits within the range of DB2 DOUBLEs.
public static  floatnormalizeREAL(float v)
     normalizeREAL checks the validity of the given java float that it fits within the range of DB2 REALs.
public static  floatnormalizeREAL(double v)
     normalizeREAL checks the validity of the given java double that it fits within the range of DB2 REALs.
final protected  booleanobjectNull(Object o)
    
public  NumberDataValueplus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result)
     This method implements the + operator for TINYINT,SMALLINT,INT.
public  voidsetBigDecimal(Number bigDecimal)
     setValue for integral exact numerics.
 voidsetObject(Object theValue)
     Set the value from a correctly typed Integer object.
public  voidsetValue(short theValue)
     Common code to handle converting a short to this value by using the int to this value conversion.
public  voidsetValue(byte theValue)
     Common code to handle converting a byte to this value by using the int to this value conversion.
public  voidsetValue(Number theValue)
    
public  NumberDataValuesqrt(NumberDataValue result)
     This is the sqrt method. this object's sqrt value.
abstract protected  inttypeCompare(DataValueDescriptor arg)
     Compare this (not null) to a non-null value.
public  inttypeToBigDecimal()
     Implementation for integral types.

Field Detail
MAXLONG_PLUS_ONE
static Comparable MAXLONG_PLUS_ONE(Code)
Set by the booting DataValueFactory implementation.



MINLONG_MINUS_ONE
static Comparable MINLONG_MINUS_ONE(Code)
Set by the booting DataValueFactory implementation.



ZERO_DECIMAL
static DataValueDescriptor ZERO_DECIMAL(Code)
Set by the booting DataValueFactory implementation.





Method Detail
absolute
final public NumberDataValue absolute(NumberDataValue result) throws StandardException(Code)
Numbers check for isNegative first and negate it if negative. this object's absolute value. Null if object is null.
exception:
  StandardException - thrown on error.



compare
final public int compare(DataValueDescriptor arg) throws StandardException(Code)

exception:
  StandardException - Thrown on error



compare
final public boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException(Code)

exception:
  StandardException - thrown on error



divide
public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException(Code)
This method implements the / operator for TINYINT, SMALLINT and INTEGER. Specialized methods are not required for TINYINT and SMALLINT as the Java virtual machine always executes byte and int division as integer.
Parameters:
  dividend - The numerator
Parameters:
  divisor - The denominator
Parameters:
  result - The result of a previous call to this method, nullif not called yet A SQLInteger containing the result of the division
exception:
  StandardException - Thrown on error



divide
public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException(Code)
Suitable for integral types that ignore scale.



getDecimalValuePrecision
public int getDecimalValuePrecision()(Code)
Return the precision of this specific DECIMAL value. If the value does not represent a SQL DECIMAL then the return is undefined.



getDecimalValueScale
public int getDecimalValueScale()(Code)
Return the scale of this specific DECIMAL value. If the value does not represent a SQL DECIMAL then the return is undefined.



isNegative
abstract protected boolean isNegative()(Code)
The isNegative abstract method. Checks to see if this.value is negative. To be implemented by each NumberDataType. A boolean. If this.value is negative, return true.For positive values or null, return false.



minus
public NumberDataValue minus(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code)
This method implements the - operator for TINYINT, SMALLINT and INTEGER.
Parameters:
  left - The value to be subtracted from
Parameters:
  right - The value to be subtracted
Parameters:
  result - The result of a previous call to this method, nullif not called yet A SQLInteger containing the result of the subtraction
exception:
  StandardException - Thrown on error



mod
public NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException(Code)



normalizeDOUBLE
public static double normalizeDOUBLE(double v) throws StandardException(Code)
normalizeDOUBLE checks the validity of the given java double that it fits within the range of DB2 DOUBLEs. In addition it normalizes the value, so that negative zero (-0.0) becomes positive.



normalizeREAL
public static float normalizeREAL(float v) throws StandardException(Code)
normalizeREAL checks the validity of the given java float that it fits within the range of DB2 REALs. In addition it normalizes the value, so that negative zero (-0.0) becomes positive.



normalizeREAL
public static float normalizeREAL(double v) throws StandardException(Code)
normalizeREAL checks the validity of the given java double that it fits within the range of DB2 REALs. In addition it normalizes the value, so that negative zero (-0.0) becomes positive. The reason for having normalizeREAL with two signatures is to avoid that normalizeREAL is called with a casted (float)doublevalue, since this invokes an unwanted rounding (of underflow values to 0.0), in contradiction to DB2s casting semantics.



objectNull
final protected boolean objectNull(Object o)(Code)



plus
public NumberDataValue plus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result) throws StandardException(Code)
This method implements the + operator for TINYINT,SMALLINT,INT.
Parameters:
  addend1 - One of the addends
Parameters:
  addend2 - The other addend
Parameters:
  result - The result of a previous call to this method, nullif not called yet A NumberDataValue containing the result of the addition
exception:
  StandardException - Thrown on error



setBigDecimal
public void setBigDecimal(Number bigDecimal) throws StandardException(Code)
setValue for integral exact numerics. Converts the BigDecimal to a long to preserve precision



setObject
void setObject(Object theValue) throws StandardException(Code)
Set the value from a correctly typed Integer object. Used for TINYINT, SMALLINT, INTEGER.
throws:
  StandardException -



setValue
public void setValue(short theValue) throws StandardException(Code)
Common code to handle converting a short to this value by using the int to this value conversion. Simply calls setValue(int).



setValue
public void setValue(byte theValue) throws StandardException(Code)
Common code to handle converting a byte to this value by using the int to this value conversion. Simply calls setValue(int).



setValue
public void setValue(Number theValue) throws StandardException(Code)
Common code to handle java.lang.Integer as a Number, used for TINYINT, SMALLINT, INTEGER
See Also:   NumberDataValue.setValue
exception:
  StandardException - Thrown on error



sqrt
public NumberDataValue sqrt(NumberDataValue result) throws StandardException(Code)
This is the sqrt method. this object's sqrt value. Null if object is null.Note: -0.0f and -0.0d returns 0.0f and 0.0d.
exception:
  StandardException - thrown on a negative number.



typeCompare
abstract protected int typeCompare(DataValueDescriptor arg) throws StandardException(Code)
Compare this (not null) to a non-null value.
exception:
  StandardException - Thrown on error



typeToBigDecimal
public int typeToBigDecimal()(Code)
Implementation for integral types. Convert to a BigDecimal using long



Methods inherited from org.apache.derby.iapi.types.DataType
public void checkHostVariable(int declaredLength) throws StandardException(Code)(Java Doc)
public Object cloneObject()(Code)(Java Doc)
public DataValueDescriptor coalesce(DataValueDescriptor[] argumentsList, DataValueDescriptor returnValue) throws StandardException(Code)(Java Doc)
public boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException(Code)(Java Doc)
final protected StandardException dataTypeConversion(String targetType)(Code)(Java Doc)
public BooleanDataValue equals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc)
public boolean equals(Object other)(Code)(Java Doc)
protected static int flip(int operator)(Code)(Java Doc)
void genericSetObject(Object theValue) throws StandardException(Code)(Java Doc)
public boolean getBoolean() throws StandardException(Code)(Java Doc)
public byte getByte() throws StandardException(Code)(Java Doc)
public byte[] getBytes() throws StandardException(Code)(Java Doc)
public Date getDate(Calendar cal) throws StandardException(Code)(Java Doc)
public double getDouble() throws StandardException(Code)(Java Doc)
public float getFloat() throws StandardException(Code)(Java Doc)
public int getInt() throws StandardException(Code)(Java Doc)
public long getLong() throws StandardException(Code)(Java Doc)
protected String getNationalString(LocaleFinder localeFinder) throws StandardException(Code)(Java Doc)
public Object getObject() throws StandardException(Code)(Java Doc)
public short getShort() throws StandardException(Code)(Java Doc)
public InputStream getStream() throws StandardException(Code)(Java Doc)
public Time getTime(Calendar cal) throws StandardException(Code)(Java Doc)
public Timestamp getTimestamp(Calendar cal) throws StandardException(Code)(Java Doc)
public String getTraceString() throws StandardException(Code)(Java Doc)
String getTypeName(String className)(Code)(Java Doc)
public BooleanDataValue greaterOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc)
public BooleanDataValue greaterThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc)
public BooleanDataValue in(DataValueDescriptor left, DataValueDescriptor[] inList, boolean orderedList) throws StandardException(Code)(Java Doc)
final protected StandardException invalidFormat()(Code)(Java Doc)
final public BooleanDataValue isNotNull()(Code)(Java Doc)
final public BooleanDataValue isNullOp()(Code)(Java Doc)
public BooleanDataValue lessOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc)
public BooleanDataValue lessThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc)
public void normalize(DataTypeDescriptor desiredType, DataValueDescriptor source) throws StandardException(Code)(Java Doc)
public BooleanDataValue notEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc)
final protected StandardException outOfRange()(Code)(Java Doc)
public void setBigDecimal(Number bigDecimal) throws StandardException(Code)(Java Doc)
protected void setFrom(DataValueDescriptor dvd) throws StandardException(Code)(Java Doc)
public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException(Code)(Java Doc)
public void setInto(ResultSet rs, int position) throws SQLException, StandardException(Code)(Java Doc)
void setObject(Object theValue) throws StandardException(Code)(Java Doc)
public void setObjectForCast(Object theValue, boolean instanceOfResultType, String resultTypeClassName) throws StandardException(Code)(Java Doc)
public void setToNull()(Code)(Java Doc)
public void setValue(Time theValue) throws StandardException(Code)(Java Doc)
public void setValue(Time theValue, Calendar cal) throws StandardException(Code)(Java Doc)
public void setValue(Timestamp theValue) throws StandardException(Code)(Java Doc)
public void setValue(Timestamp theValue, Calendar cal) throws StandardException(Code)(Java Doc)
public void setValue(Date theValue) throws StandardException(Code)(Java Doc)
public void setValue(Date theValue, Calendar cal) throws StandardException(Code)(Java Doc)
public void setValue(String theValue) throws StandardException(Code)(Java Doc)
public void setValue(int theValue) throws StandardException(Code)(Java Doc)
public void setValue(double theValue) throws StandardException(Code)(Java Doc)
public void setValue(float theValue) throws StandardException(Code)(Java Doc)
public void setValue(short theValue) throws StandardException(Code)(Java Doc)
public void setValue(long theValue) throws StandardException(Code)(Java Doc)
public void setValue(byte theValue) throws StandardException(Code)(Java Doc)
public void setValue(boolean theValue) throws StandardException(Code)(Java Doc)
public void setValue(byte[] theValue) throws StandardException(Code)(Java Doc)
final public void setValue(DataValueDescriptor dvd) throws StandardException(Code)(Java Doc)
public void setValue(InputStream theStream, int valueLength) throws StandardException(Code)(Java Doc)
public void throwLangSetMismatch(Object value) throws StandardException(Code)(Java Doc)
void throwLangSetMismatch(String argTypeName) throws StandardException(Code)(Java Doc)
public int typePrecedence()(Code)(Java Doc)
public int typeToBigDecimal() throws StandardException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.