Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.util.clprompter
Class ClOperator

java.lang.Object
  extended by com.ibm.etools.iseries.rse.util.clprompter.ClOperator

public class ClOperator
extends Object

Since:
6.0

Field Summary
static String Copyright
           
static int MIN_PRIORITY
           
 
Constructor Summary
ClOperator(String text)
          the constructor for this class
 
Method Summary
static void genCCSIDOperators()
          Used to speed up initialization by generating operators that have CCSID dependancies....
 int getPriority(boolean highest)
          Indicates the priority of the operator in an expression.
 String getStringWithoutSpaces()
          retrieves the operator without spaces.
 boolean isEqual()
          indicates whether or not this operator is an equals operator
 boolean isNot()
          Indicates if the operator is a NOT operator
 boolean isNot(boolean checkBoth)
          Indicates if the operator is a NOT operator
 boolean isSign()
          Indicates whether or not the operator is indicating a signed decimal
 boolean isValidOperand(Object object)
          Indicates whether or not an operand is valid for this operator
static boolean isValidRelationalOperands(Object operand1, Object operand2)
          Indicates whether or not the two operands are valid for a relational operator
static String queryStartsWithArithmaticOperator(String text)
          Query the string to see if starts with an arithmatic operator.
static String queryStartsWithCharacterOperator(String text)
          Query the string to see if starts with a character operator.
static String queryStartsWithLogicalOperator(String text)
          Query the string to see if starts with a logical operator.
static String queryStartsWithPredefinedCharacterOperator(String text)
          Query the string to see if starts with a predefined character operator.
static String queryStartsWithPredefinedLogicalOperator(String text)
          Query the string to see if starts with a predefined logical operator.
static String queryStartsWithPredefinedRelationalOperator(String text)
          Query the string to see if starts with a predefined relational operator.
static String queryStartsWithRelationalOperator(String text)
          Query the string to see if starts with a relational operator.
 void setIsSign(boolean value)
          allows configuration as to whether or not the +/- is a sign or an operator.
 String toString()
          Returns the operator with blanks before and after it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

MIN_PRIORITY

public static final int MIN_PRIORITY
See Also:
Constant Field Values
Constructor Detail

ClOperator

public ClOperator(String text)
the constructor for this class

Parameters:
text - The text that makes up the operator.
Method Detail

queryStartsWithPredefinedCharacterOperator

public static String queryStartsWithPredefinedCharacterOperator(String text)
Query the string to see if starts with a predefined character operator.

Parameters:
text - the String to query
Returns:
The predefined character operator found at the start of the text. Null if no predefined operator was found.

queryStartsWithPredefinedLogicalOperator

public static String queryStartsWithPredefinedLogicalOperator(String text)
Query the string to see if starts with a predefined logical operator.

Parameters:
text - the String to query
Returns:
The predefined logical operator found at the start of the text. Null if no predefined operator was found.

queryStartsWithPredefinedRelationalOperator

public static String queryStartsWithPredefinedRelationalOperator(String text)
Query the string to see if starts with a predefined relational operator.

Parameters:
text - the String to query
Returns:
The predefined relational operator found at the start of the text. Null if no predefined operator was found.

queryStartsWithLogicalOperator

public static String queryStartsWithLogicalOperator(String text)
Query the string to see if starts with a logical operator.

Parameters:
text - the String to query
Returns:
The logical operator found at the start of the text. Null if no predefined operator was found.

queryStartsWithCharacterOperator

public static String queryStartsWithCharacterOperator(String text)
Query the string to see if starts with a character operator.

Parameters:
text - the String to query
Returns:
The character operator found at the start of the text. Null if no predefined operator was found.

queryStartsWithRelationalOperator

public static String queryStartsWithRelationalOperator(String text)
Query the string to see if starts with a relational operator.

Parameters:
text - the String to query
Returns:
The relational operator found at the start of the text. Null if no predefined operator was found.

queryStartsWithArithmaticOperator

public static String queryStartsWithArithmaticOperator(String text)
Query the string to see if starts with an arithmatic operator.

Parameters:
text - the String to query
Returns:
The arithmatic operator found at the start of the text. Null if no predefined operator was found.

genCCSIDOperators

public static void genCCSIDOperators()
Used to speed up initialization by generating operators that have CCSID dependancies....


toString

public String toString()
Returns the operator with blanks before and after it

Overrides:
toString in class Object

getPriority

public int getPriority(boolean highest)
Indicates the priority of the operator in an expression. Priority 1 operators have only one operand.

Parameters:
highest - set to true if you want the highest available priority returned for this operator.
Returns:
the numeric value of the priority where 1 is the highest, and 7 is the lowest.

isValidOperand

public boolean isValidOperand(Object object)
Indicates whether or not an operand is valid for this operator

Parameters:
object - The operand to check for validity
Returns:
true if the operand is valid, false otherwise.

isNot

public boolean isNot()
Indicates if the operator is a NOT operator

Returns:
true if *NOT or ¬, false otherwise

isNot

public boolean isNot(boolean checkBoth)
Indicates if the operator is a NOT operator

Parameters:
checkBoth - true if both *NOT and ¬ should be check, false if only ¬ should be checked
Returns:
true this operator is a NOT false otherwise

isSign

public boolean isSign()
Indicates whether or not the operator is indicating a signed decimal

Returns:
true if the operator is + or -, false otherwise.

isValidRelationalOperands

public static boolean isValidRelationalOperands(Object operand1,
                                                Object operand2)
Indicates whether or not the two operands are valid for a relational operator

Parameters:
operand1 - the first object to compare
operand2 - the second object to compare
Returns:
true if the operands specified are allowed, false otherwise

setIsSign

public void setIsSign(boolean value)
allows configuration as to whether or not the +/- is a sign or an operator. Ignored for all other operators.

Parameters:
value - true if the operator is for a signed decimal, false otherwise.

getStringWithoutSpaces

public String getStringWithoutSpaces()
retrieves the operator without spaces.

Returns:
the operator string without any space padding.

isEqual

public boolean isEqual()
indicates whether or not this operator is an equals operator

Returns:
tru if this operator is *EQ or =

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.