public class Function extends Object implements Expression
LanguageObject.Util
Constructor and Description |
---|
Function(String name,
Expression[] args)
Construct a function with function name and array of arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
Object |
clone()
Return a deep copy of this object.
|
boolean |
equals(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.
|
String |
getName()
Get name of function
|
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 |
isAggregate() |
boolean |
isEval() |
boolean |
isImplicit()
Return true if this function is implicit and should not be shown in SQL representations
|
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 |
setEval(boolean eval) |
void |
setFunctionDescriptor(FunctionDescriptor fd)
Set the descriptor for this function.
|
void |
setImplicit(boolean implicit) |
void |
setName(String name) |
void |
setType(Class<?> type)
Set type of function
|
String |
toString()
Return string representation of the function.
|
protected Class<?> type
public Function(String name, Expression[] args)
name
- Name of functionargs
- Function argumentspublic String getName()
public void setName(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 setImplicit(boolean implicit)
public void insertConversion(int index, FunctionDescriptor functionDescriptor)
index
- Argument index to insert conversion function atfunctionDescriptor
- Conversion function descriptorpublic Class<?> getType()
getType
in interface Expression
public void setType(Class<?> type)
type
- New typepublic FunctionDescriptor getFunctionDescriptor()
public void setFunctionDescriptor(FunctionDescriptor fd)
fd
- Function descriptorpublic void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
visitor
- Visitor being usedpublic boolean equals(Object obj)
public int hashCode()
public Object clone()
clone
in interface LanguageObject
clone
in class Object
public boolean isAggregate()
public String toString()
public boolean isEval()
public void setEval(boolean eval)
Copyright © 2019. All rights reserved.