Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.db.sql
Class Operation

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.sql.AbstractSQLFragment
              extended by oracle.javatools.db.sql.Operation
All Implemented Interfaces:
ChildDBObject, DBObject, SQLFragment, Copyable, DynamicPropertySet
Direct Known Subclasses:
ArithmeticOperation, Comparison, DataMiningFunction, ExpressionList, Function, FunctionUsage, GroupByExpression, SetOperation, WhereObject

public abstract class Operation
extends AbstractSQLFragment

Abstract class for operations. Consists of a set of arguments and an operation text. The operator can be of a "function format"
OPERATION(arg1, arg2, arg3 ...)
or not
arg1 OPERATION arg2 OPERATION arg3 ...

Since:
10.1.3

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
 
Fields inherited from class oracle.javatools.db.sql.AbstractSQLFragment
DEFAULT_SEPARATOR, EMPTY, EMPTY_ARRAY, NEWLINE, SPACE
 
Fields inherited from interface oracle.javatools.db.sql.SQLFragment
CONNECTBY, FROM, GROUPBY, HAVING, NOCYCLE, ORDERBY, SELECT, STARTWITH, TYPE, WHERE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
Operation()
           
Operation(SQLFragment[] args)
           
 
Method Summary
 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)
           
 
Methods inherited from class oracle.javatools.db.sql.AbstractSQLFragment
appendToBuffer, argsToString, getTextOrNull, getTextOrNull, getType, setParent, surroundWithBrackets, surroundWithBrackets, toString
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
findParent, getParent, getProperty, setProperty
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.ChildDBObject
getParent
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Constructor Detail

Operation

public Operation()

Operation

public Operation(SQLFragment[] args)
Method Detail

setFunctionFormat

protected void setFunctionFormat(boolean boo)
Sets whether this operation is formatted like a function. i.e.
true - OPERATION(arg1, arg2)
false - arg1 OPERATION arg2 OPERATION arg3


setCommutative

protected void setCommutative(boolean boo)
Sets whether the operation is commutative. If it isn't, then brackets are used to surround child fragments that are of the same operation type.


getArguments

public SQLFragment[] getArguments()
Returns the arguments stored in this function.


setArguments

public void setArguments(SQLFragment[] arguments)
Sets the arguments for this function.


addArgument

public void addArgument(SQLFragment expression)

addArgument

public void addArgument(int index,
                        SQLFragment expression)

addArguments

public void addArguments(SQLFragment[] expressions)

removeArgument

public boolean removeArgument(SQLFragment expression)

checkNewSize

protected void checkNewSize(int proposedSize)
Override for operations that have specific size restrictions. Subclasses should throw an IllegalArgumentException if the proposed new size is illegal.


getArgumentCount

public int getArgumentCount()
Returns the number of arguments stored.


getOperatorText

protected abstract java.lang.String getOperatorText()

checkArgument

protected void checkArgument(java.util.List<SQLFragment> existing,
                             SQLFragment add)
                      throws java.lang.IllegalArgumentException
If this returns true the Operation checks that the type of all arguments is the same.

Throws:
java.lang.IllegalArgumentException

setSeparator

protected void setSeparator(java.lang.String separator)

getSeparator

protected java.lang.String getSeparator()

getDistinctText

protected java.lang.String getDistinctText()
Override this for aggregate functions which may take a DISTINCT/UNIQUE/ALL qualifier.


getSQLText

public java.lang.String getSQLText()
Returns the complete SQL representation for this Function fragment.

Returns:
a string representing the SQL text for this object.

equalsImpl

protected boolean equalsImpl(AbstractDBObject other)
Description copied from class: AbstractDBObject
Equals implementation for testing equality with another AbstractDBObject. Override this method (with exact signature) to customise the equality comparison.

Overrides:
equalsImpl in class AbstractDBObject

copyToImpl

protected void copyToImpl(AbstractDBObject target,
                          DBObject copyParent,
                          IDPolicy idPolicy)
Description copied from class: AbstractDBObject
Implementation method for making a copy of this object. To add custom copyTo logic, a subclass must override this method (exactly), and must call back to the super implementation.

Overrides:
copyToImpl in class AbstractChildDBObject
Parameters:
target - the copy being created of this object
copyParent - 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.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.