Java Doc for OgnlOps.java in  » Scripting » OGNL » ognl » 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 » Scripting » OGNL » ognl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ognl.OgnlOps

OgnlOps
abstract public class OgnlOps implements NumericTypes(Code)
This is an abstract class with static methods that define the operations of OGNL.
author:
   Luke Blanshard (blanshlu@netscape.net)
author:
   Drew Davidson (drew@ognl.org)




Method Summary
public static  Objectadd(Object v1, Object v2)
    
public static  BigDecimalbigDecValue(Object value)
     Evaluates the given object as a BigDecimal.
public static  BigIntegerbigIntValue(Object value)
     Evaluates the given object as a BigInteger.
public static  ObjectbinaryAnd(Object v1, Object v2)
    
public static  ObjectbinaryOr(Object v1, Object v2)
    
public static  ObjectbinaryXor(Object v1, Object v2)
    
public static  ObjectbitNegate(Object value)
    
public static  booleanbooleanValue(Object value)
     Evaluates the given object as a boolean: if it is a Boolean object, it's easy; if it's a Number or a Character, returns true for non-zero objects; and otherwise returns true for non-null objects.
public static  intcompareWithConversion(Object v1, Object v2)
     Compares two objects for equality, even if it has to convert one of them to the other type.
public static  intcompareWithConversion(Object v1, Object v2, boolean equals)
     Compares two objects for equality, even if it has to convert one of them to the other type.
public static  ObjectconvertValue(Object value, Class toType)
     Returns the value converted numerically to the given class type This method also detects when arrays are being converted and converts the components of one array to the type of the other.
public static  Objectdivide(Object v1, Object v2)
    
public static  doubledoubleValue(Object value)
     Evaluates the given object as a double-precision floating-point number.
public static  booleanequal(Object v1, Object v2)
    
public static  intgetNumericType(Object value)
     Returns a constant from the NumericTypes interface that represents the numeric type of the given object.
public static  intgetNumericType(Object v1, Object v2)
     Returns the constant from the NumericTypes interface that best expresses the type of a numeric operation on the two given objects.
public static  intgetNumericType(int t1, int t2, boolean canBeNonNumeric)
     Returns the constant from the NumericTypes interface that best expresses the type of an operation, which can be either numeric or not, on the two given types.
public static  intgetNumericType(Object v1, Object v2, boolean canBeNonNumeric)
     Returns the constant from the NumericTypes interface that best expresses the type of an operation, which can be either numeric or not, on the two given objects.
public static  booleangreater(Object v1, Object v2)
    
public static  booleanin(Object v1, Object v2)
    
public static  booleanisEqual(Object object1, Object object2)
     Returns true if object1 is equal to object2 in either the sense that they are the same object or, if both are non-null if they are equal in the equals() sense.
public static  booleanless(Object v1, Object v2)
    
public static  longlongValue(Object value)
     Evaluates the given object as a long integer.
public static  Objectmultiply(Object v1, Object v2)
    
public static  Objectnegate(Object value)
    
public static  NumbernewInteger(int type, long value)
     Returns a new Number object of an appropriate type to hold the given integer value.
public static  NumbernewReal(int type, double value)
     Returns a new Number object of an appropriate type to hold the given real value.
public static  Objectremainder(Object v1, Object v2)
    
public static  ObjectshiftLeft(Object v1, Object v2)
    
public static  ObjectshiftRight(Object v1, Object v2)
    
public static  StringstringValue(Object value, boolean trim)
     Evaluates the given object as a String and trims it if the trim flag is true.
public static  StringstringValue(Object value)
     Evaluates the given object as a String.
public static  Objectsubtract(Object v1, Object v2)
    
public static  ObjectunsignedShiftRight(Object v1, Object v2)
    



Method Detail
add
public static Object add(Object v1, Object v2)(Code)



bigDecValue
public static BigDecimal bigDecValue(Object value) throws NumberFormatException(Code)
Evaluates the given object as a BigDecimal.
Parameters:
  value - an object to interpret as a BigDecimal the BigDecimal value implied by the given object
throws:
  NumberFormatException - if the given object can't be understood as a BigDecimal



bigIntValue
public static BigInteger bigIntValue(Object value) throws NumberFormatException(Code)
Evaluates the given object as a BigInteger.
Parameters:
  value - an object to interpret as a BigInteger the BigInteger value implied by the given object
throws:
  NumberFormatException - if the given object can't be understood as a BigInteger



binaryAnd
public static Object binaryAnd(Object v1, Object v2)(Code)



binaryOr
public static Object binaryOr(Object v1, Object v2)(Code)



binaryXor
public static Object binaryXor(Object v1, Object v2)(Code)



bitNegate
public static Object bitNegate(Object value)(Code)



booleanValue
public static boolean booleanValue(Object value)(Code)
Evaluates the given object as a boolean: if it is a Boolean object, it's easy; if it's a Number or a Character, returns true for non-zero objects; and otherwise returns true for non-null objects.
Parameters:
  value - an object to interpret as a boolean the boolean value implied by the given object



compareWithConversion
public static int compareWithConversion(Object v1, Object v2)(Code)
Compares two objects for equality, even if it has to convert one of them to the other type. If both objects are numeric they are converted to the widest type and compared. If one is non-numeric and one is numeric the non-numeric is converted to double and compared to the double numeric value. If both are non-numeric and Comparable and the types are compatible (i.e. v1 is of the same or superclass of v2's type) they are compared with Comparable.compareTo(). If both values are non-numeric and not Comparable or of incompatible classes this will throw and IllegalArgumentException.
Parameters:
  v1 - First value to compare
Parameters:
  v2 - second value to compare integer describing the comparison between the two objects.A negative number indicates that v1 < v2. Positive indicatesthat v1 > v2. Zero indicates v1 == v2.
throws:
  IllegalArgumentException - if the objects are both non-numericyet of incompatible types or do not implement Comparable.



compareWithConversion
public static int compareWithConversion(Object v1, Object v2, boolean equals)(Code)
Compares two objects for equality, even if it has to convert one of them to the other type. If both objects are numeric they are converted to the widest type and compared. If one is non-numeric and one is numeric the non-numeric is converted to double and compared to the double numeric value. If both are non-numeric and Comparable and the types are compatible (i.e. v1 is of the same or superclass of v2's type) they are compared with Comparable.compareTo(). If both values are non-numeric and not Comparable or of incompatible classes this will throw and IllegalArgumentException.
Parameters:
  v1 - First value to compare
Parameters:
  v2 - second value to compare integer describing the comparison between the two objects.A negative number indicates that v1 < v2. Positive indicatesthat v1 > v2. Zero indicates v1 == v2.
throws:
  IllegalArgumentException - if the objects are both non-numericyet of incompatible types or do not implement Comparable.



convertValue
public static Object convertValue(Object value, Class toType)(Code)
Returns the value converted numerically to the given class type This method also detects when arrays are being converted and converts the components of one array to the type of the other.
Parameters:
  value - an object to be converted to the given type
Parameters:
  toType - class type to be converted to converted value of the type given, or value if the valuecannot be converted to the given type.



divide
public static Object divide(Object v1, Object v2)(Code)



doubleValue
public static double doubleValue(Object value) throws NumberFormatException(Code)
Evaluates the given object as a double-precision floating-point number.
Parameters:
  value - an object to interpret as a double the double value implied by the given object
throws:
  NumberFormatException - if the given object can't be understood as a double



equal
public static boolean equal(Object v1, Object v2)(Code)



getNumericType
public static int getNumericType(Object value)(Code)
Returns a constant from the NumericTypes interface that represents the numeric type of the given object.
Parameters:
  value - an object that needs to be interpreted as a number the appropriate constant from the NumericTypes interface



getNumericType
public static int getNumericType(Object v1, Object v2)(Code)
Returns the constant from the NumericTypes interface that best expresses the type of a numeric operation on the two given objects.
Parameters:
  v1 - one argument to a numeric operator
Parameters:
  v2 - the other argument the appropriate constant from the NumericTypes interface



getNumericType
public static int getNumericType(int t1, int t2, boolean canBeNonNumeric)(Code)
Returns the constant from the NumericTypes interface that best expresses the type of an operation, which can be either numeric or not, on the two given types.
Parameters:
  t1 - type of one argument to an operator
Parameters:
  t2 - type of the other argument
Parameters:
  canBeNonNumeric - whether the operator can be interpreted as non-numeric the appropriate constant from the NumericTypes interface



getNumericType
public static int getNumericType(Object v1, Object v2, boolean canBeNonNumeric)(Code)
Returns the constant from the NumericTypes interface that best expresses the type of an operation, which can be either numeric or not, on the two given objects.
Parameters:
  v1 - one argument to an operator
Parameters:
  v2 - the other argument
Parameters:
  canBeNonNumeric - whether the operator can be interpreted as non-numeric the appropriate constant from the NumericTypes interface



greater
public static boolean greater(Object v1, Object v2)(Code)



in
public static boolean in(Object v1, Object v2) throws OgnlException(Code)



isEqual
public static boolean isEqual(Object object1, Object object2)(Code)
Returns true if object1 is equal to object2 in either the sense that they are the same object or, if both are non-null if they are equal in the equals() sense.
Parameters:
  v1 - First object to compare
Parameters:
  v2 - Second object to compare true if v1 == v2



less
public static boolean less(Object v1, Object v2)(Code)



longValue
public static long longValue(Object value) throws NumberFormatException(Code)
Evaluates the given object as a long integer.
Parameters:
  value - an object to interpret as a long integer the long integer value implied by the given object
throws:
  NumberFormatException - if the given object can't be understood as a long integer



multiply
public static Object multiply(Object v1, Object v2)(Code)



negate
public static Object negate(Object value)(Code)



newInteger
public static Number newInteger(int type, long value)(Code)
Returns a new Number object of an appropriate type to hold the given integer value. The type of the returned object is consistent with the given type argument, which is a constant from the NumericTypes interface.
Parameters:
  type - the nominal numeric type of the result, a constant from the NumericTypes interface
Parameters:
  value - the integer value to convert to a Number object a Number object with the given value, of type implied by the type argument



newReal
public static Number newReal(int type, double value)(Code)
Returns a new Number object of an appropriate type to hold the given real value. The type of the returned object is always either Float or Double, and is only Float if the given type tag (a constant from the NumericTypes interface) is FLOAT.
Parameters:
  type - the nominal numeric type of the result, a constant from the NumericTypes interface
Parameters:
  value - the real value to convert to a Number object a Number object with the given value, of type implied by the type argument



remainder
public static Object remainder(Object v1, Object v2)(Code)



shiftLeft
public static Object shiftLeft(Object v1, Object v2)(Code)



shiftRight
public static Object shiftRight(Object v1, Object v2)(Code)



stringValue
public static String stringValue(Object value, boolean trim)(Code)
Evaluates the given object as a String and trims it if the trim flag is true.
Parameters:
  value - an object to interpret as a String the String value implied by the given object as returned by the toString() method,or "null" if the object is null.



stringValue
public static String stringValue(Object value)(Code)
Evaluates the given object as a String.
Parameters:
  value - an object to interpret as a String the String value implied by the given object as returned by the toString() method,or "null" if the object is null.



subtract
public static Object subtract(Object v1, Object v2)(Code)



unsignedShiftRight
public static Object unsignedShiftRight(Object v1, Object v2)(Code)



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.