public abstract class Operation extends AbstractSQLFragment
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport
COMMA, DEFAULT_SEPARATOR, EMPTY, EMPTY_ARRAY, INDENT, NEWLINE, SPACE
Constructor and Description |
---|
Operation() |
Operation(SQLFragment[] args) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(int index, SQLFragment expression) |
void |
addArgument(SQLFragment expression) |
void |
addArguments(SQLFragment[] expressions) |
protected void |
checkArgument(java.util.List<SQLFragment> existing, SQLFragment add)
If this returns true the Operation checks that the type of all arguments is the same.
|
protected void |
checkNewSize(int proposedSize)
Override for operations that have specific size restrictions.
|
protected void |
copyToImpl(AbstractDBObject target, DBObject copyParent, IDPolicy idPolicy)
Implementation method for making a copy of this object.
|
protected boolean |
equalsImpl(AbstractDBObject other)
Equals implementation for testing equality with another AbstractDBObject.
|
int |
getArgumentCount()
Returns the number of arguments stored.
|
SQLFragment[] |
getArguments()
Returns the arguments stored in this function.
|
protected java.lang.String |
getDistinctText()
Override this for aggregate functions which may take a DISTINCT/UNIQUE/ALL qualifier.
|
protected abstract java.lang.String |
getOperatorText() |
protected java.lang.String |
getSeparator() |
java.lang.String |
getSQLText()
Returns the complete SQL representation for this Function fragment.
|
boolean |
removeArgument(SQLFragment expression) |
void |
setArguments(SQLFragment[] arguments)
Sets the arguments for this function.
|
protected void |
setCommutative(boolean boo)
Sets whether the operation is commutative.
|
protected void |
setFunctionFormat(boolean boo)
Sets whether this operation is formatted like a function.
|
protected void |
setSeparator(java.lang.String separator) |
appendToBuffer, argsToString, getStartOffset, getTextOrNull, getTextOrNull, getType, setStartOffset, surroundWithBrackets, surroundWithBrackets, toString
setParent
checkInit, checkInit, fireObjectUpdated, getOwnedObjectsImpl, getProperties, getReferenceIDsImpl, needsInitialization
addObjectListener, addObjectListener, addObjectListener, changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, findOwnedObject, findParent, firePropertyChanged, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeObjectListener, removeObjectListener, removeObjectListener, removeOwnedObject, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, setProperty
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getParent, setParent
addObjectListener, copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getProperties, getReferenceIDs, removeObjectListener, removeOwnedObject, replaceReferenceIDs, setID, setName
getProperty, getProperty, setProperties, setProperty
public Operation()
public Operation(SQLFragment[] args)
protected void setFunctionFormat(boolean boo)
true
- OPERATION(arg1, arg2)false
- arg1 OPERATION arg2 OPERATION arg3protected void setCommutative(boolean boo)
public SQLFragment[] getArguments()
public void setArguments(SQLFragment[] arguments)
public void addArgument(SQLFragment expression)
public void addArgument(int index, SQLFragment expression)
public void addArguments(SQLFragment[] expressions)
public boolean removeArgument(SQLFragment expression)
protected void checkNewSize(int proposedSize)
public int getArgumentCount()
protected abstract java.lang.String getOperatorText()
protected void checkArgument(java.util.List<SQLFragment> existing, SQLFragment add) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
protected void setSeparator(java.lang.String separator)
protected java.lang.String getSeparator()
protected java.lang.String getDistinctText()
public java.lang.String getSQLText()
protected boolean equalsImpl(AbstractDBObject other)
AbstractDBObject
equalsImpl
in class AbstractBuildableObject
protected void copyToImpl(AbstractDBObject target, DBObject copyParent, IDPolicy idPolicy)
AbstractDBObject
copyToImpl
in class AbstractBuildableObject
target
- the copy being created of this objectcopyParent
- if this object is being copied underneath a parent, this parameter is the copy of the parent of this object, which will therefore need to be the parent of the copy of this object.idPolicy
- the policy for copying the object's ID.