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

E13403-04

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(Operation target, DBObject copyParent, IDPolicy idPolicy)
           
protected  boolean equalsImpl(Operation other)
           
 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
copyToImpl, findParent, getParent
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, 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(Operation other)

copyToImpl

protected void copyToImpl(Operation target,
                          DBObject copyParent,
                          IDPolicy idPolicy)

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

E13403-04

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