Java Doc for Operator.java in  » Workflow-Engines » osbl-1_0 » org » osbl » agent » model » condition » 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 » Workflow Engines » osbl 1_0 » org.osbl.agent.model.condition 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.osbl.agent.model.condition.Operator

All known Subclasses:   org.osbl.agent.model.condition.BinaryOperator,  org.osbl.agent.model.condition.MethodOperator,
Operator
abstract public class Operator (Code)
This class represents an operator which can be used in Conditions to evaluate the operands specified in them. It is defined abstract to allow different kinds of operators. At the time of evaluation the concrete class of the operator has to provide a valid Java expression by overriding Operator.getExpression(String,String) . For constructing such expression, the implementation can (and generally will) use whatever is stored in the operatorCode. For presentation purposes (for example when adding it to a ComboBox) it is possible to assign a descriptive user friendly label to the operator.
author:
   Sebastian Nozzi.



Constructor Summary
public  Operator()
     Instantiates a new operator.
public  Operator(String operatorString)
     Instantiates a new operator with a given String, serving both for code and for label.
public  Operator(String label, String operatorCode)
     Instantiates a new operator, specifying label and code.

Method Summary
public  booleanequals(Object obj)
     Two operators are equal if their classes match and their internal code matches (which is used in constructing the evaluating expression and therefor is a vital and differentiating part of an operator).
public  booleanevaluate(String leftExpression, String rightExpression, RuleContext context)
     Perform the defined evaluation in this operator.
abstract protected  StringgetExpression(String left, String right)
     Subclasses override and implement this method, in which they should return a valid Java (actually OGNL) expression that is then evaluated. The implementation uses the given left and right parts and most certainly also the stored operatorCode (that defines more or less the nature of the operation).
Parameters:
  left - the left part of the expression.
Parameters:
  right - the right part of the expression.
public  StringgetLabel()
     Gets the a descriptive label of the operator.
public  StringgetOperatorCode()
     Gets the operator code.
public  booleanisNegated()
     Checks if the result of the evaluation will be negated.
public  voidsetLabel(String label)
     Sets a descriptive label for the operator.
public  voidsetNegated(boolean negated)
     Sets wether the result of the evaluation via this operator will be negated or not.
public  voidsetOperatorCode(String operatorCode)
     Sets the operator code, which aids the operator class to construct its evaluating expression.
public  StringtoString()
     Uses the specified label to return a friendly String version.


Constructor Detail
Operator
public Operator()(Code)
Instantiates a new operator.



Operator
public Operator(String operatorString)(Code)
Instantiates a new operator with a given String, serving both for code and for label.
Parameters:
  operatorString - the operator string.



Operator
public Operator(String label, String operatorCode)(Code)
Instantiates a new operator, specifying label and code.
Parameters:
  label - the label.
Parameters:
  operatorCode - the operator code.




Method Detail
equals
public boolean equals(Object obj)(Code)
Two operators are equal if their classes match and their internal code matches (which is used in constructing the evaluating expression and therefor is a vital and differentiating part of an operator). If the classes don't match, the default implementation is used.
Parameters:
  obj - the obj true, if equals
See Also:   java.lang.Object.equals(java.lang.Object)



evaluate
public boolean evaluate(String leftExpression, String rightExpression, RuleContext context)(Code)
Perform the defined evaluation in this operator. The passed parameters left and rightExpression are also implementation dependant. They would be typically the left and right operands. A "root object" also has to be specified, for which all references to methods and/or fields are relative to.
Parameters:
  leftExpression - the left expression, or operand
Parameters:
  rightExpression - the right expression, or operand
Parameters:
  context - the context the boolean result if the evaluation was successful, false in case of error.



getExpression
abstract protected String getExpression(String left, String right)(Code)
Subclasses override and implement this method, in which they should return a valid Java (actually OGNL) expression that is then evaluated. The implementation uses the given left and right parts and most certainly also the stored operatorCode (that defines more or less the nature of the operation).
Parameters:
  left - the left part of the expression.
Parameters:
  right - the right part of the expression. the expression as suitable for the concrete implemented operator.



getLabel
public String getLabel()(Code)
Gets the a descriptive label of the operator. the label



getOperatorCode
public String getOperatorCode()(Code)
Gets the operator code. the operator code.



isNegated
public boolean isNegated()(Code)
Checks if the result of the evaluation will be negated. true, if result will be negated.



setLabel
public void setLabel(String label)(Code)
Sets a descriptive label for the operator.
Parameters:
  label - the new label.



setNegated
public void setNegated(boolean negated)(Code)
Sets wether the result of the evaluation via this operator will be negated or not.
Parameters:
  negated - true, if it should be negated, false if not.



setOperatorCode
public void setOperatorCode(String operatorCode)(Code)
Sets the operator code, which aids the operator class to construct its evaluating expression.
Parameters:
  operatorCode - the new operator code.



toString
public String toString()(Code)
Uses the specified label to return a friendly String version. the string
See Also:   Operator.setLabel(String)
See Also:   Operator.getLabel()
See Also:   java.lang.Object.toString



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.