***  This class is subject to change.  ***

com.sas.iquery.metadata.serverprop
Class Operator

com.sas.iquery.metadata.serverprop.Operator
All Implemented Interfaces:
LocalizableNamedObjectInterface, NamedObjectInterface, com.sas.util.LocalizableToStringInterface

@ThreadSafe
public final class Operator

Models an operator definition that can be used within expressions to perform more complex queries. This class extends the Function class because operators can be viewed as functions with one or two parameters. For example, the A+B expression using the "+" operator can also be viewed as +(A,B) where "+" is a function instead of an operator. In this modeling context, they can be viewed as equivalent. We model operators as extensions of the Function class, and not as Functions themselves, since visuals and users who interact with them prefer to use an operator syntax and that operator syntax requires an operator precedence which does not apply for functions since their arguments are delineated by parentheses and operators are not.

To model an expression using an operator definition use the FunctionCall class.

See Also:
FunctionCall, Function

Method Summary
 boolean equals(java.lang.Object obj)
           
 int getPrecedence()
          Returns the relative precedence of this operator's definition.
 int hashCode()
           
 boolean isBinary()
          Returns whether this operator definition is for a binary operator or not.
 boolean isUnary()
          Returns whether this operator definition is for a unary operator or not.
 
Methods inherited from class com.sas.iquery.metadata.serverprop.Function
getArgumentCount, getCategory, getCompatibleSignature, getDescription, getDescription, getDescriptions, getFunctionNameID, getID, getLabel, getLabel, getLabels, getNameID, getSignatures, getSyntaxTemplateFor, getSyntaxToken, getToolTip, getToolTip, isDistinct, isInCategory
 

Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Function
Parameters:
obj - Object to compare this one to.
Returns:
true if equal, false otherwise. Null is checked.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Function
Returns:
int hashcode for this object.
See Also:
Object.hashCode()

***  This method is subject to change.  ***

getPrecedence

public int getPrecedence()
Returns the relative precedence of this operator's definition. Operators with a lower precedence number has higher precedence. Operators with a precedence of 0, have the highest precedence.

Returns:
the relative precedence of this operator's definition.

***  This method is subject to change.  ***

isUnary

public boolean isUnary()
Returns whether this operator definition is for a unary operator or not. For example, in the expression -A+B the negation operator in front of A is a unary operator (it takes one argument) while the + operator is a binary operator, taking -A and B as its arguments.

Returns:
true if this operator is a unary operator, false otherwise.

***  This method is subject to change.  ***

isBinary

public boolean isBinary()
Returns whether this operator definition is for a binary operator or not. For example, in the expression -A+B the negation operator in front of A is a unary operator (it takes one argument) while the + operator is a binary operator, taking -A and B as its arguments.

Returns:
true if this operator is a binary operator, false otherwise.

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.