|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.query.sql.symbol.Function
public class Function
Represents a function in a sql statement. A function is a type of expression. Functions have a name and some arguments (0..n). Each argument is also an expression. After resolution, a function should have a type and a function descriptor.
| Constructor Summary | |
|---|---|
Function(java.lang.String name,
Expression[] args)
Construct a function with function name and array of arguments. |
|
| Method Summary | |
|---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor. |
java.lang.Object |
clone()
Return a deep copy of this object. |
boolean |
equals(java.lang.Object obj)
Compare for equality |
Expression |
getArg(int index)
Get argument at specified index |
Expression[] |
getArgs()
Get function arguments |
FunctionDescriptor |
getFunctionDescriptor()
Get the function descriptor that this function resolves to. |
java.lang.String |
getName()
Get name of function |
java.lang.Class |
getType()
Get type of function, if known |
int |
hashCode()
Compute hash code for the object - based on name and hashcode of first arg (if there is one) |
void |
insertConversion(int index,
FunctionDescriptor functionDescriptor)
Insert a conversion function at specified index. |
boolean |
isImplicit()
Return true if this function is implicit and should not be shown in SQL representations |
boolean |
isResolved()
Return true if expression has been fully resolved. |
void |
makeImplicit()
Make this function implicit / hidden. |
void |
setArgs(Expression[] args)
Set the function arguments - it is assumed that the args are not null. |
void |
setFunctionDescriptor(FunctionDescriptor fd)
Set the descriptor for this function. |
void |
setName(java.lang.String name)
|
void |
setType(java.lang.Class type)
Set type of function |
java.lang.String |
toString()
Return string representation of the function. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Function(java.lang.String name,
Expression[] args)
name - Name of functionargs - Function arguments| Method Detail |
|---|
public java.lang.String getName()
public void setName(java.lang.String name)
public Expression[] getArgs()
public Expression getArg(int index)
index - Index of argumentpublic void setArgs(Expression[] args)
args - Function argumentspublic void makeImplicit()
public boolean isImplicit()
public void insertConversion(int index,
FunctionDescriptor functionDescriptor)
index - Argument index to insert conversion function atfunctionDescriptor - Conversion function descriptorpublic java.lang.Class getType()
getType in interface Expressionpublic void setType(java.lang.Class type)
type - New typepublic FunctionDescriptor getFunctionDescriptor()
public void setFunctionDescriptor(FunctionDescriptor fd)
fd - Function descriptorpublic boolean isResolved()
isResolved in interface Expressionpublic void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor in interface LanguageObjectvisitor - Visitor being usedpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Other object to compare
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in interface LanguageObjectclone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||