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

E13403-08

oracle.javatools.db
Class AbstractDBObjectID

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObjectID
All Implemented Interfaces:
DBObjectID, Copyable
Direct Known Subclasses:
BaseObjectID

public abstract class AbstractDBObjectID
extends java.lang.Object
implements DBObjectID

Abstract implementation of DBObjectID for subclassing by DBObjectID implementations.


Constructor Summary
protected AbstractDBObjectID()
           
protected AbstractDBObjectID(java.lang.String type)
           
protected AbstractDBObjectID(java.lang.String type, DBObjectID parent)
           
 
Method Summary
protected  void copyToImpl(AbstractDBObjectID target)
           
 boolean equals(DBObjectID id, boolean strict)
          The equals implementation will order the IDs if appropriate, compare parent IDs (if any exist) and then call equalsImpl.
 boolean equals(java.lang.Object obj)
          By default calls for a strict equals comparison.
protected  boolean equalsImpl(AbstractDBObjectID target)
          Returns true if the type of the IDs is the same.
protected abstract  boolean equalsImpl(DBObjectID id, boolean strict)
          Subclasses should implement as appropriate to their equals implementation, calling equalsImpl(AbstractDBObjectID) when appropriate.
 DBObjectID getParent()
          Gets this id's parent id (if one exists)
 java.lang.String getType()
          Retrieves the type of object referenced by this id.
 int hashCode()
           
protected  boolean hasSameParent(DBObjectID other, boolean strict)
          Compares the parent of this id with the parent of another id, optionally as a strict comparison.
protected  DBObject resolveFromParent()
          If the id's parent is non-null this tries to resolve the parent ID and then search the parent's children for an object with this ID.
protected  DBObject resolveInParentObject(DBObject parent)
          Used by resolvefromParent to find the object corresponding to this ID in the given parent object.
 void setParent(DBObjectID parent)
          Sets this id's parent id
 void setType(java.lang.String type)
           
abstract  java.lang.String toString()
          Subclasses of this abstract ID must implement toString to return a String representation of the ID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.DBObjectID
resolveID
 
Methods inherited from interface oracle.javatools.util.Copyable
copyTo
 

Constructor Detail

AbstractDBObjectID

protected AbstractDBObjectID()

AbstractDBObjectID

protected AbstractDBObjectID(java.lang.String type)

AbstractDBObjectID

protected AbstractDBObjectID(java.lang.String type,
                             DBObjectID parent)
Method Detail

getType

public final java.lang.String getType()
Description copied from interface: DBObjectID
Retrieves the type of object referenced by this id.

Specified by:
getType in interface DBObjectID
Returns:
the type of object
See Also:
DBObject.getType();

setType

public final void setType(java.lang.String type)

getParent

public final DBObjectID getParent()
Gets this id's parent id (if one exists)

Specified by:
getParent in interface DBObjectID

setParent

public void setParent(DBObjectID parent)
Sets this id's parent id


resolveFromParent

protected final DBObject resolveFromParent()
                                    throws DBException
If the id's parent is non-null this tries to resolve the parent ID and then search the parent's children for an object with this ID.

Throws:
DBException

resolveInParentObject

protected DBObject resolveInParentObject(DBObject parent)
Used by resolvefromParent to find the object corresponding to this ID in the given parent object.

Parameters:
parent - the object to look under for an object matching this ID.

equals

public final boolean equals(java.lang.Object obj)
By default calls for a strict equals comparison.

Overrides:
equals in class java.lang.Object

equals

public final boolean equals(DBObjectID id,
                            boolean strict)
The equals implementation will order the IDs if appropriate, compare parent IDs (if any exist) and then call equalsImpl.

Specified by:
equals in interface DBObjectID
Parameters:
id - the DBObjectID being checked for equality
strict - whether a strict definition of equality should be used.
Returns:
whether the id is equal to this
See Also:
equalsImpl(DBObjectID,boolean)

hasSameParent

protected boolean hasSameParent(DBObjectID other,
                                boolean strict)
Compares the parent of this id with the parent of another id, optionally as a strict comparison.


equalsImpl

protected abstract boolean equalsImpl(DBObjectID id,
                                      boolean strict)
Subclasses should implement as appropriate to their equals implementation, calling equalsImpl(AbstractDBObjectID) when appropriate.


equalsImpl

protected boolean equalsImpl(AbstractDBObjectID target)
Returns true if the type of the IDs is the same. The parents are not compared as that is done by the equals implementation.


copyToImpl

protected void copyToImpl(AbstractDBObjectID target)

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public abstract java.lang.String toString()
Subclasses of this abstract ID must implement toString to return a String representation of the ID. This is used for the hashCode. The toString() on two copies of the same ID must equate.

Overrides:
toString in class java.lang.Object

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

E13403-08

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