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

E13403-07

oracle.javatools.db.diff
Class ResultSet

java.lang.Object
  extended by oracle.javatools.db.diff.Difference
      extended by oracle.javatools.db.diff.ResultSet
All Implemented Interfaces:
Copyable, DynamicPropertySet

public class ResultSet
extends Difference

Since:
10.1.3

Field Summary
static java.lang.String LEAF
           
static java.lang.String LIST
           
static java.lang.String MAP
           
static java.lang.String ORIGINAL
           
static java.lang.String UPDATED
           
 
Constructor Summary
ResultSet(ResultSet parent, boolean same, java.lang.Object a, java.lang.Object b, java.lang.String propertyName)
          Create a fully populated leaf node in the result set
ResultSet(ResultSet parent, java.lang.Object a, java.lang.Object b, int indexOfA, int indexOfB, java.lang.String name, java.lang.String type)
          create a LIST result node attached to its parent
ResultSet(ResultSet parent, java.lang.Object a, java.lang.Object b, java.lang.String name, java.lang.String type)
          create a result node attached to its parent
 
Method Summary
 java.lang.Object a()
           
 void addToList(ResultSet rs)
           
 void addToMap(java.lang.String name, ResultSet rs)
           
 java.lang.Object b()
           
 ResultSet copyTo(java.lang.Object target)
          Copies the internal state of this object to the specified copy.
protected  void copyToImpl(ResultSet copy)
           
 java.util.List<ResultSet> getAList()
          get a list of the objects which are in A
 java.util.List<ResultSet> getAllObjectsList()
          If this is a LIST result set, return a copy of the list.
 java.util.Map<java.lang.String,ResultSet> getAllObjectsMap()
          If this is a MAP ResultSet, return a copy of the Map.
 java.util.List<ResultSet> getAonlyList()
          get a list of the objects which are in A and not in B
 java.util.Map getAonlyMap()
          If this is a MAP ResultSet, return a Map of the objects that are only in A
 java.util.List<ResultSet> getBList()
          get a list of the objects which are in B
 java.util.List<ResultSet> getBonlyList()
          get a list of the objects which are in B but not in A
 java.util.Map<java.lang.String,ResultSet> getBonlyMap()
          If this is a MAP ResultSet, return a Map of the objects that are only in B
 java.util.Iterator<ResultSet> getChildIterator()
          Deprecated. use getChildren().iterator()
 java.util.Collection<ResultSet> getChildren()
          Gets all the children of this Difference.
 java.lang.Class getDifferenceClass()
          Gets the Class of the object this Difference is for.
 ResultSet getFilteredResultSet(DifferenceFilter rsf)
          Deprecated. use getFilteredDifference
 int getIndexOf(java.lang.String contributor)
          Get the index of the contributor in a list.
 int getIndexOfA()
           
 int getIndexOfB()
           
 java.util.List<Difference> getList(java.lang.String contributor)
           
 java.util.List<ResultSet> getModifiedObjectList()
          get a list of the objects which are in A and B and are not the same
 java.util.Map<java.lang.String,ResultSet> getModifiedObjectMap()
          get a map of the attributes which have been modified.
 java.lang.String getName()
          The ResultSet name is the base for the node names in the reconcile UI It also makes the ResultSet dumps more readable.
 java.util.List<ResultSet> getNotSameObjectList()
          get a list of the objects which are not the same.
 java.util.Map<java.lang.String,ResultSet> getNotSameObjectMap()
          get a map of the attributes which are not the same.
 java.lang.Object getObject(java.lang.String contributor)
          Get an object which contributes to the Difference.
 java.lang.String getOriginalContributor()
          Get the name of the contributor which describes the origianl object.
 ResultSet getParent()
          Gets the parent of this Difference, if one exists.
 java.lang.String getPropertyName()
          Returns the name of the property that this ResultSet is representing.
 java.lang.Class getResultSetClass()
          get the class of the object of this ResultSet
 java.lang.Object getResultSetObject()
          Gets an object for this result set - i.e.
 java.lang.String getType()
          Get a String representing the type of the ResultSet (LIST, MAP or LEAF)
 java.lang.String getUpdateContributor()
          Get the name of the contributor which describes the changes the user wishes to apply.
 boolean inA()
           
 boolean inAbutNotB()
           
 boolean inB()
           
 boolean inBbutNotA()
           
 boolean isChildListReorder()
           
 boolean isLeaf()
          Is this Difference a leaf? That is, it cannot have child differences.
 boolean isList()
          Is this difference a list? That is, a list of children.
 boolean isMap()
          Is this Difference a map? This is, a map of child attributes.
 boolean isModified()
          Both the original and the update contibutors have This object, but it is different.
 void setA(java.lang.Object a)
           
 void setB(java.lang.Object b)
           
 void setListReordered(boolean listReordered)
           
 void setName(java.lang.String name)
           
protected  void setType(java.lang.String type)
          Sets the type of this ResultSet as done at construction.
 void setUpdateContributor(java.lang.String contributor)
          Set the name of the contributor which describes the changes the user wishes to apply.
 
Methods inherited from class oracle.javatools.db.diff.Difference
copyToImpl, getFilteredDifference, getIndexOfOriginalObject, getIndexOfUpdatedObject, getOriginalObject, getProperties, getProperty, getProperty, getPropertyPath, getUpdatedObject, isSame, print, print, setParent, setProperties, setProperty, setSame, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LIST

public static final java.lang.String LIST
See Also:
Constant Field Values

MAP

public static final java.lang.String MAP
See Also:
Constant Field Values

LEAF

public static final java.lang.String LEAF
See Also:
Constant Field Values

ORIGINAL

public static java.lang.String ORIGINAL

UPDATED

public static java.lang.String UPDATED
Constructor Detail

ResultSet

public ResultSet(ResultSet parent,
                 java.lang.Object a,
                 java.lang.Object b,
                 int indexOfA,
                 int indexOfB,
                 java.lang.String name,
                 java.lang.String type)
create a LIST result node attached to its parent

Parameters:
parent -
a -
b -
name - - take this as the property name for a leaf or a list, use it as the object name for a map
type - MAP - an object difference node LIST - a list property node LEAF - a property/attribute node

ResultSet

public ResultSet(ResultSet parent,
                 java.lang.Object a,
                 java.lang.Object b,
                 java.lang.String name,
                 java.lang.String type)
create a result node attached to its parent

Parameters:
parent -
a -
b -
name - - take this as the property name for a leaf or a list, use it as the object name for a map
type - MAP - an object difference node LIST - a list property node LEAF - a property/attribute node

ResultSet

public ResultSet(ResultSet parent,
                 boolean same,
                 java.lang.Object a,
                 java.lang.Object b,
                 java.lang.String propertyName)
Create a fully populated leaf node in the result set

Parameters:
parent - - this is expected to be a map node; a map of the leaf attributes
same - - true if the attribute are the same
a - - the parent 'a' object, eg Table, Column, etc.
b - - the parent 'b' object, eg Table, Column, etc.
propertyName -
Method Detail

setType

protected void setType(java.lang.String type)
Sets the type of this ResultSet as done at construction. This will empty any existing children so should only be used before the object is processed.


getParent

public ResultSet getParent()
Description copied from class: Difference
Gets the parent of this Difference, if one exists.

Overrides:
getParent in class Difference
Returns:
the parent if this Difference is the child of another Difference

getType

public java.lang.String getType()
Get a String representing the type of the ResultSet (LIST, MAP or LEAF)


addToList

public void addToList(ResultSet rs)

addToMap

public void addToMap(java.lang.String name,
                     ResultSet rs)

isModified

public boolean isModified()
Description copied from class: Difference
Both the original and the update contibutors have This object, but it is different.

Specified by:
isModified in class Difference

a

public java.lang.Object a()

setA

public void setA(java.lang.Object a)

b

public java.lang.Object b()

setB

public void setB(java.lang.Object b)

setName

public void setName(java.lang.String name)

getPropertyName

public java.lang.String getPropertyName()
Returns the name of the property that this ResultSet is representing. If the ResultSet is an object's MAP this will return the object name.

Specified by:
getPropertyName in class Difference

getName

public java.lang.String getName()
The ResultSet name is the base for the node names in the reconcile UI It also makes the ResultSet dumps more readable. If the ResultSet has not been given a name, and is the result of a DBObject comparisson, then the DBObject name is returned.


isChildListReorder

public boolean isChildListReorder()

setListReordered

public void setListReordered(boolean listReordered)

getModifiedObjectList

public java.util.List<ResultSet> getModifiedObjectList()
get a list of the objects which are in A and B and are not the same

Returns:

getNotSameObjectList

public java.util.List<ResultSet> getNotSameObjectList()
get a list of the objects which are not the same. They may be in A only, or B only or in both.

Returns:

inBbutNotA

public boolean inBbutNotA()

getIndexOfA

public int getIndexOfA()

getIndexOfB

public int getIndexOfB()

getIndexOf

public int getIndexOf(java.lang.String contributor)
Description copied from class: Difference
Get the index of the contributor in a list.

Specified by:
getIndexOf in class Difference

getAList

public java.util.List<ResultSet> getAList()
get a list of the objects which are in A

Returns:

getBList

public java.util.List<ResultSet> getBList()
get a list of the objects which are in B

Returns:

getBonlyList

public java.util.List<ResultSet> getBonlyList()
get a list of the objects which are in B but not in A

Returns:

inA

public boolean inA()

inB

public boolean inB()

inAbutNotB

public boolean inAbutNotB()

getAonlyList

public java.util.List<ResultSet> getAonlyList()
get a list of the objects which are in A and not in B

Returns:

getAllObjectsList

public java.util.List<ResultSet> getAllObjectsList()
If this is a LIST result set, return a copy of the list. Otherwise, return null.


getModifiedObjectMap

public java.util.Map<java.lang.String,ResultSet> getModifiedObjectMap()
get a map of the attributes which have been modified. Note, this map does not include added or dropped attributes.

Returns:

getNotSameObjectMap

public java.util.Map<java.lang.String,ResultSet> getNotSameObjectMap()
get a map of the attributes which are not the same. Note, this map includes added and dropped attributes.

Returns:

getBonlyMap

public java.util.Map<java.lang.String,ResultSet> getBonlyMap()
If this is a MAP ResultSet, return a Map of the objects that are only in B


getAonlyMap

public java.util.Map getAonlyMap()
If this is a MAP ResultSet, return a Map of the objects that are only in A


getAllObjectsMap

public java.util.Map<java.lang.String,ResultSet> getAllObjectsMap()
If this is a MAP ResultSet, return a copy of the Map. Otherwise, return null.


getResultSetClass

public java.lang.Class getResultSetClass()
get the class of the object of this ResultSet


getResultSetObject

public java.lang.Object getResultSetObject()
Gets an object for this result set - i.e. a, or if null b.


getChildren

public java.util.Collection<ResultSet> getChildren()
Description copied from class: Difference
Gets all the children of this Difference. For example the Difference for a Table will have a child Difference for its list of Columns, etc.

Specified by:
getChildren in class Difference
Returns:
the children of this Difference

getChildIterator

@Deprecated
public java.util.Iterator<ResultSet> getChildIterator()
Deprecated. use getChildren().iterator()

get an iterator over the children of this result set


copyTo

public ResultSet copyTo(java.lang.Object target)
Description copied from interface: Copyable
Copies the internal state of this object to the specified copy. If copy is null, then this method should create a new instance of this class and proceed to copy the internal state to the newly created object. Generally, only the persistent state of the object should be copied, but whether or not it is appropriate to copy transient properties is at the discretion of the individual implementor.

Regardless of whether the copy occurs to an existing object or to a newly created object, the return value is object to which this object's state was copied.

There is a standard implementation pattern for the copyTo method that helps avoid problems that arise when a Copyable object is subclassed. The pattern is:


    public Object copyTo( Object target )
    {
      final <this_class> copy =
        target != null ? (<this_class>) target : new <this_class>();
      copyToImpl( copy );
      return copy;
    }

    protected final void copyToImpl( <this_class> copy )
    {
      super.copyToImpl( copy );  //  if necessary
      //  put code here for copying the properties of <this_class>
    }
  
The parameter passed into the copyToImpl method is the same type of this class. The responsibility of copyToImpl is to copy the state of this class through direct access of the fields. The copyToImpl method should not use getters and setters since these may be overridden, causing the state of this class to be incompletely copied.

Parameters:
target - The target object to which the state of this object should be copied. If target is null, then the copyTo method will return a new instance of this class.
Returns:
The object to which the state of this object was copied. If the target was non-null, then the return value is the same as the target object that was passed in; otherwise, the return value is a new instance of this class.

copyToImpl

protected void copyToImpl(ResultSet copy)

getFilteredResultSet

@Deprecated
public ResultSet getFilteredResultSet(DifferenceFilter rsf)
Deprecated. use getFilteredDifference


isLeaf

public boolean isLeaf()
Description copied from class: Difference
Is this Difference a leaf? That is, it cannot have child differences.

Specified by:
isLeaf in class Difference

isMap

public boolean isMap()
Description copied from class: Difference
Is this Difference a map? This is, a map of child attributes. For example, the attributes of a table.

Specified by:
isMap in class Difference

isList

public boolean isList()
Description copied from class: Difference
Is this difference a list? That is, a list of children. For example, the columns of a table.

Specified by:
isList in class Difference

getObject

public java.lang.Object getObject(java.lang.String contributor)
Description copied from class: Difference
Get an object which contributes to the Difference.

Specified by:
getObject in class Difference

getList

public java.util.List<Difference> getList(java.lang.String contributor)

getOriginalContributor

public java.lang.String getOriginalContributor()
Description copied from class: Difference
Get the name of the contributor which describes the origianl object.

Specified by:
getOriginalContributor in class Difference

getDifferenceClass

public java.lang.Class getDifferenceClass()
Description copied from class: Difference
Gets the Class of the object this Difference is for.

Specified by:
getDifferenceClass in class Difference
Returns:
the Class of the object in this Difference

setUpdateContributor

public void setUpdateContributor(java.lang.String contributor)
Description copied from class: Difference
Set the name of the contributor which describes the changes the user wishes to apply.

Specified by:
setUpdateContributor in class Difference

getUpdateContributor

public java.lang.String getUpdateContributor()
Description copied from class: Difference
Get the name of the contributor which describes the changes the user wishes to apply.

Specified by:
getUpdateContributor in class Difference

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

E13403-07

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