Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.db.diff
Class Difference

java.lang.Object
  extended by oracle.javatools.db.diff.Difference

All Implemented Interfaces:
Copyable, DynamicPropertySet
Direct Known Subclasses:
ResultSet

public abstract class Difference
extends java.lang.Object
implements Copyable, DynamicPropertySet

Represents the difference between two versions of the same object.

Since:
11.1.1.2.0

Constructor Summary
Difference()
           

 

Method Summary
protected  void copyToImpl(Difference other)
          Subclasses should call this as part of the Copyable implementation.
abstract  java.util.Collection<? extends Difference> getChildren()
          Gets all the children of this Difference.
abstract  java.lang.Class getDifferenceClass()
          Gets the Class of the object this Difference is for.
 Difference getFilteredDifference(DifferenceFilter... filters)
          Filters this Difference using the given filter and returns a new filtered Difference.
abstract  int getIndexOf(java.lang.String contributor)
          Get the index of the contributor in a list.
 int getIndexOfOriginalObject()
          Get the index of the original object.
 int getIndexOfUpdatedObject()
          Get the index of the updated object.
abstract  java.lang.Object getObject(java.lang.String contributor)
          Get an object which contributes to the Difference.
abstract  java.lang.String getOriginalContributor()
          Get the name of the contributor which describes the origianl object.
 java.lang.Object getOriginalObject()
          Get the original object.
 Difference getParent()
          Gets the parent of this Difference, if one exists.
 java.util.Map getProperties()
          Retrieves a map holding the property-value pairs.
 java.lang.Object getProperty(java.lang.String key)
          Retrieves the value associated with a property.
 java.lang.Object getProperty(java.lang.String key, java.lang.Object defaultValue)
          Retrieves the value associated with a property.
abstract  java.lang.String getPropertyName()
          Get the property name of this difference.
 java.lang.String getPropertyPath()
          Get the property path of this difference.
abstract  java.lang.String getUpdateContributor()
          Get the name of the contributor which describes the changes the user wishes to apply.
 java.lang.Object getUpdatedObject()
          Get the updated object.
abstract  boolean isLeaf()
          Is this Difference a leaf? That is, it cannot have child differences.
abstract  boolean isList()
          Is this difference a list? That is, a list of children.
abstract  boolean isMap()
          Is this Difference a map? This is, a map of child attributes.
abstract  boolean isModified()
          Both the original and the update contibutors have This object, but it is different.
 boolean isSame()
          All the contributor agree that this object is the same
 void print()
          For Diagnostic purposes, print the difference to the this class's Logger at the tracing log level.
 void print(java.util.logging.Logger logger, java.util.logging.Level level)
          Prints this different to the given Logger and Level.
protected  void setParent(Difference parent)
          Sets the parent of the Difference
 void setProperties(java.util.Map properties)
          Sets the map holding the property-value pairs.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets the value for a property.
 void setSame(boolean same)
          Overrides whether this Difference is the same (i.e.
abstract  void setUpdateContributor(java.lang.String contributor)
          Set the name of the contributor which describes the changes the user wishes to apply.
 java.lang.String toString()
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface oracle.javatools.util.Copyable
copyTo

 

Constructor Detail

Difference

public Difference()

Method Detail

getParent

public Difference getParent()
Gets the parent of this Difference, if one exists.
Returns:
the parent if this Difference is the child of another Difference

setParent

protected void setParent(Difference parent)
Sets the parent of the Difference
Parameters:
parent - the Difference for the parent object or property of this Difference.

getPropertyName

public abstract java.lang.String getPropertyName()
Get the property name of this difference. This may be null if the difference represents an object rather than a property.

getPropertyPath

public java.lang.String getPropertyPath()
Get the property path of this difference. This is the path from the top object being diffed all the way down to this property node. Uses the parent Difference's property names.
See Also:
getPropertyName()

isModified

public abstract boolean isModified()
Both the original and the update contibutors have This object, but it is different.

isSame

public boolean isSame()
All the contributor agree that this object is the same

setSame

public void setSame(boolean same)
Overrides whether this Difference is the same (i.e. there is no Difference between the objects).

isLeaf

public abstract boolean isLeaf()
Is this Difference a leaf? That is, it cannot have child differences.

isMap

public abstract boolean isMap()
Is this Difference a map? This is, a map of child attributes. For example, the attributes of a table.

isList

public abstract boolean isList()
Is this difference a list? That is, a list of children. For example, the columns of a table.

getObject

public abstract java.lang.Object getObject(java.lang.String contributor)
Get an object which contributes to the Difference.

getIndexOf

public abstract int getIndexOf(java.lang.String contributor)
Get the index of the contributor in a list.

setUpdateContributor

public abstract void setUpdateContributor(java.lang.String contributor)
Set the name of the contributor which describes the changes the user wishes to apply.

getOriginalContributor

public abstract java.lang.String getOriginalContributor()
Get the name of the contributor which describes the origianl object.

getUpdateContributor

public abstract java.lang.String getUpdateContributor()
Get the name of the contributor which describes the changes the user wishes to apply.

getChildren

public abstract java.util.Collection<? extends Difference> getChildren()
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.
Returns:
the children of this Difference

getDifferenceClass

public abstract java.lang.Class getDifferenceClass()
Gets the Class of the object this Difference is for.
Returns:
the Class of the object in this Difference

getOriginalObject

public final java.lang.Object getOriginalObject()
Get the original object. This is the object that the user started with.

getUpdatedObject

public final java.lang.Object getUpdatedObject()
Get the updated object. This object reflects the changes which the user wants to apply.

getIndexOfOriginalObject

public final int getIndexOfOriginalObject()
Get the index of the original object.

getIndexOfUpdatedObject

public final int getIndexOfUpdatedObject()
Get the index of the updated object.

getFilteredDifference

public Difference getFilteredDifference(DifferenceFilter... filters)
Filters this Difference using the given filter and returns a new filtered Difference.
Parameters:
filter -
Returns:
a new Difference filtered

getProperties

public final java.util.Map getProperties()
Description copied from interface: DynamicPropertySet
Retrieves a map holding the property-value pairs.
Specified by:
getProperties in interface DynamicPropertySet

getProperty

public final java.lang.Object getProperty(java.lang.String key)
Description copied from interface: DynamicPropertySet
Retrieves the value associated with a property.
Specified by:
getProperty in interface DynamicPropertySet
Parameters:
key - the property key for which a value is desired. exists.
Returns:
the value of the requested property, or a null value if the property does not exist or is not set.

getProperty

public final java.lang.Object getProperty(java.lang.String key,
                                          java.lang.Object defaultValue)
Description copied from interface: DynamicPropertySet
Retrieves the value associated with a property. If no value exists for the requested property, the specified default value is returned.
Specified by:
getProperty in interface DynamicPropertySet
Parameters:
key - the property key for which a value is desired.
defaultValue - the value to return if no value currently exists.
Returns:
the value of the requested property, or the default value if the property does not exist.

setProperties

public final void setProperties(java.util.Map properties)
Description copied from interface: DynamicPropertySet
Sets the map holding the property-value pairs.
Specified by:
setProperties in interface DynamicPropertySet

setProperty

public final void setProperty(java.lang.String key,
                              java.lang.Object value)
Description copied from interface: DynamicPropertySet
Sets the value for a property. Setting a value to null removes that property.
Specified by:
setProperty in interface DynamicPropertySet
Parameters:
key - the property key to set
value - the value to set

copyToImpl

protected void copyToImpl(Difference other)
Subclasses should call this as part of the Copyable implementation.

print

public final void print()
For Diagnostic purposes, print the difference to the this class's Logger at the tracing log level.

print

public final void print(java.util.logging.Logger logger,
                        java.util.logging.Level level)
Prints this different to the given Logger and Level.
Parameters:
logger - the logger to print to
level - the level to print at

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


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