Oracle9i Business Components for Java InterMedia API Reference
Oracle9i JDeveloper (9.0.4)
B10394-01

oracle.ord.im
Class OrdImageSignatureDomain

java.lang.Object
  |
  +--oracle.ord.im.OrdImageSignatureBase
        |
        +--oracle.ord.im.OrdImageSignature
              |
              +--oracle.ord.im.OrdImageSignatureDomain
All Implemented Interfaces:
oracle.jbo.domain.BlobDomainInterface, oracle.sql.CustomDatum, oracle.sql.CustomDatumFactory, oracle.jbo.domain.DomainInterface, oracle.jbo.domain.LobInterface, oracle.jbo.domain.MutableDomainInterface, oracle.jdbc.internal.ObjectData, oracle.jdbc.internal.ObjectDataFactory, OrdDomainState, OrdDomainSupportInterface, java.io.Serializable, oracle.jbo.domain.XMLDomainInterface, oracle.jbo.domain.XMLDomainReaderFactory, oracle.jbo.domain.XMLDomainWriter, oracle.jbo.domain.XMLValueFactory

public class OrdImageSignatureDomain
extends OrdImageSignature
implements oracle.jbo.domain.LobInterface, OrdDomainState, OrdDomainSupportInterface, oracle.jbo.domain.XMLDomainReaderFactory, oracle.jbo.domain.XMLDomainWriter, java.io.Serializable

Represents interMedia ORDSYS.ORDImageSignature database type as a domain class in the Business Components for Java (BC4J) framework. The methods in this class allow users to compare images for similarity.

Since:
JDev5.0
See Also:
OrdImageSignature, Serialized Form

Field Summary

 

Fields inherited from class oracle.ord.im.OrdImageSignatureBase
_SQL_NAME, _SQL_TYPECODE

 

Constructor Summary
OrdImageSignatureDomain()
          Constructs a new OrdImageSignatureDomain instance.

 

Method Summary
 oracle.sql.CustomDatum create(oracle.sql.Datum d, int sqlType)
          Internal: Applications should not use this method.
 java.lang.Object createDomainFromSerializedXML(org.w3c.dom.Element element)
          Create a domain instance by reading the xml-data out of the given xml-node.
 boolean equals(java.lang.Object obj)
          Compares the signatures in the two OrdImageSignatureDomain objects.
static float evaluateScore(OrdImageSignature signature1, OrdImageSignature signature2, java.lang.String attrWeights)
          Compares two image signatures, returning a score that indicates the degree of difference between the image signatures.
 void generateSignature(OrdImage img)
          Generates an image signature for the specified image.
 java.lang.Object getCTPassivationHandle()
          Internal: Applications should not use this method.
static oracle.sql.CustomDatumFactory getCustomDatumFactory()
          Internal: Applications should not use this method.
 java.lang.Object getData()
          Internal: Applications should not use this method.
static oracle.sql.CustomDatumFactory getFactory()
          Returns the OrdImageSignatureDomain CustomDatumFactory for use by the getCustomDatum method.
 oracle.jbo.domain.DomainOwnerInterface getOwner()
          Internal: Applications should not use this method.
 int getOwnerAttributeIndex()
          Internal: Applications should not use this method.
 java.lang.String getRemoteIdString()
          Internal: Applications should not use this method.
 org.w3c.dom.Node getSerializedDomainXML(org.w3c.dom.Document xmlDoc)
          Creates the XML node in the given XML document for this domain's data.
 long getSize()
          Internal: Applications should not use this method.
 int getTierInfo()
          Gets the tier number information that this object lives in.
 org.w3c.dom.Node getXMLContentNode(org.w3c.dom.Document xmlDoc)
          Internal: Applications should not use this method.
static oracle.jbo.domain.XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
          Internal: Applications should not use this method.
 boolean isConnected()
          Determines whether the domain object has an internal JDBC connection to the database.
static int isSimilar(OrdImageSignature signature1, OrdImageSignature signature2, java.lang.String attrWeights, float threshold)
          Compares two image signatures, returning a status that indicates if the degree of difference between the image signatures is within a specified threshold.
 void loadFromDatabase(oracle.jbo.Transaction xAct)
          Internal: Applications should not use this method.
 void prepareCTPassivation()
          Internal: Applications should not use this method.
 void prepareForDML(java.lang.Object context)
          Internal: Applications should not use this method.
 java.lang.String printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees)
          Internal: Applications should not use this method.
 void removeListenerFromTransaction()
          Internal: Applications should not use this method.
 void saveToDatabase(oracle.jbo.Transaction xAct)
          Internal: Applications should not use this method.
 void saveToDatabase(oracle.jbo.Transaction xAct, java.lang.Object emptySQLObject)
          Internal: Applications should not use this method.
 void setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx)
          Internal: Applications should not use this method.
 void setCTPassivationHandle(java.lang.Object handle)
          Internal: Applications should not use this method.
 void syncClientLob(oracle.jbo.domain.LobInterface newArrival)
          Internal: Applications should not use this method.
 void syncServerLob(oracle.jbo.domain.LobInterface oldObj)
          Internal: Applications should not use this method.
 java.lang.String toString()
          Returns "OrdImageSignatureDomain".

 

Methods inherited from class oracle.ord.im.OrdImageSignatureBase
toDatum

 

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

 

Constructor Detail

OrdImageSignatureDomain

public OrdImageSignatureDomain()
Constructs a new OrdImageSignatureDomain instance. The user can insert a new row with an empty ORDSYS.OrdImageSignature SQL object using the following code snippet:
   OrdImageSignatureDomain sigDomain = new OrdImageSignatureDomain();
   Row row = viewObject.createRow();
   row.setAttribute("Signature", sigDomain);
   viewObject.insertRow(row);
   appModule.getTransaction().postChanges();
Method Detail

getFactory

public static oracle.sql.CustomDatumFactory getFactory()
Returns the OrdImageSignatureDomain CustomDatumFactory for use by the getCustomDatum method. Specify this method as the factory parameter of the getCustomDatum method when retrieving an OrdImageSignatureDomain object from an OracleResultSet or OracleCallableStatement . For example:
   OrdImageSignatureDomain sig =
      (OrdImageSignatureDomain)rset.getCustomDatum(
        1, OrdImageSignatureDomain.getFactory() );
Returns:
the OrdImageSignatureDomain implementation of the CustomDatumFactory interface

getCustomDatumFactory

public static oracle.sql.CustomDatumFactory getCustomDatumFactory()
Internal: Applications should not use this method.

getData

public java.lang.Object getData()
Internal: Applications should not use this method.
Specified by:
getData in interface oracle.jbo.domain.DomainInterface

setContext

public void setContext(oracle.jbo.domain.DomainOwnerInterface owner,
                       oracle.jbo.Transaction trans,
                       java.lang.Object ctx)
Internal: Applications should not use this method.
Specified by:
setContext in interface oracle.jbo.domain.DomainInterface

toString

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

create

public oracle.sql.CustomDatum create(oracle.sql.Datum d,
                                     int sqlType)
                              throws java.sql.SQLException
Internal: Applications should not use this method.
Specified by:
create in interface oracle.sql.CustomDatumFactory
Overrides:
create in class OrdImageSignature
java.sql.SQLException

getXMLDomainFactory

public static oracle.jbo.domain.XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
Internal: Applications should not use this method.

getXMLContentNode

public org.w3c.dom.Node getXMLContentNode(org.w3c.dom.Document xmlDoc)
Internal: Applications should not use this method.
Specified by:
getXMLContentNode in interface oracle.jbo.domain.XMLDomainInterface

createDomainFromSerializedXML

public java.lang.Object createDomainFromSerializedXML(org.w3c.dom.Element element)
Create a domain instance by reading the xml-data out of the given xml-node.
Specified by:
createDomainFromSerializedXML in interface oracle.jbo.domain.XMLDomainReaderFactory

getSerializedDomainXML

public org.w3c.dom.Node getSerializedDomainXML(org.w3c.dom.Document xmlDoc)
Creates the XML node in the given XML document for this domain's data.
Specified by:
getSerializedDomainXML in interface oracle.jbo.domain.XMLDomainWriter
Parameters:
xmlDoc - name of the XML document in which the node should be created.

printXMLDefinition

public java.lang.String printXMLDefinition(java.util.Hashtable allDefs,
                                           java.io.PrintWriter pw,
                                           boolean bContainees)
Internal: Applications should not use this method.
Specified by:
printXMLDefinition in interface oracle.jbo.domain.XMLDomainInterface

equals

public boolean equals(java.lang.Object obj)
Compares the signatures in the two OrdImageSignatureDomain objects.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to be compared with this object
Returns:
true if the two OrdImageSignatureDomain have the same signatures; otherwise, returns false

generateSignature

public void generateSignature(OrdImage img)
                       throws java.sql.SQLException
Description copied from class: OrdImageSignature
Generates an image signature for the specified image.
Overrides:
generateSignature in class OrdImageSignature
Parameters:
img - an OrdImage object from which to generate the signature.
Throws:
java.sql.SQLException - if an error occurs calling the generateSignature method in the database.

syncServerLob

public void syncServerLob(oracle.jbo.domain.LobInterface oldObj)
Internal: Applications should not use this method.
Specified by:
syncServerLob in interface oracle.jbo.domain.LobInterface

syncClientLob

public void syncClientLob(oracle.jbo.domain.LobInterface newArrival)
Internal: Applications should not use this method.
Specified by:
syncClientLob in interface oracle.jbo.domain.LobInterface

getSize

public long getSize()
Internal: Applications should not use this method.
Specified by:
getSize in interface oracle.jbo.domain.LobInterface

getRemoteIdString

public java.lang.String getRemoteIdString()
Internal: Applications should not use this method.
Specified by:
getRemoteIdString in interface oracle.jbo.domain.LobInterface

saveToDatabase

public void saveToDatabase(oracle.jbo.Transaction xAct)
                    throws java.sql.SQLException
Internal: Applications should not use this method.
Specified by:
saveToDatabase in interface oracle.jbo.domain.BlobDomainInterface
java.sql.SQLException

saveToDatabase

public void saveToDatabase(oracle.jbo.Transaction xAct,
                           java.lang.Object emptySQLObject)
                    throws java.sql.SQLException,
                           java.io.IOException
Internal: Applications should not use this method.
Specified by:
saveToDatabase in interface oracle.jbo.domain.BlobDomainInterface
java.sql.SQLException
java.io.IOException

prepareForDML

public void prepareForDML(java.lang.Object context)
Internal: Applications should not use this method.
Specified by:
prepareForDML in interface oracle.jbo.domain.BlobDomainInterface

loadFromDatabase

public void loadFromDatabase(oracle.jbo.Transaction xAct)
                      throws java.lang.Exception
Internal: Applications should not use this method.
Specified by:
loadFromDatabase in interface oracle.jbo.domain.BlobDomainInterface
java.lang.Exception

getOwner

public oracle.jbo.domain.DomainOwnerInterface getOwner()
Internal: Applications should not use this method.
Specified by:
getOwner in interface oracle.jbo.domain.LobInterface

getOwnerAttributeIndex

public int getOwnerAttributeIndex()
Internal: Applications should not use this method.
Specified by:
getOwnerAttributeIndex in interface oracle.jbo.domain.LobInterface

isSimilar

public static int isSimilar(OrdImageSignature signature1,
OrdImageSignature signature2,
                            java.lang.String attrWeights,
                            float threshold)
                     throws java.sql.SQLException
Description copied from class: OrdImageSignature
Compares two image signatures, returning a status that indicates if the degree of difference between the image signatures is within a specified threshold. This method compares the image signatures in signature1 and signature2 using weights specified for one or more visual attributes. The result of the comparison is a score between 0.0 and 100.0, where a lower value indicates a closer match. If the score is less than or equal to the specified threshold, the images are considered a match and the method returns 1; otherwise, the method returns 0.

Specify a weight in the range 0.0 to 1.0 for one or more of the following visual attributes:

You must specify a value greater than 0.0 for at least one of the following attributes: color, shape, or texture. The location attribute indicates the importance of the distribution of the color, shape or texture features in the images. During processing, the values are normalized such that they total 1.0.

For example, "color=0.7,shape=0.3".

Parameters:
signature1 - an OrdImageSignature.
signature2 - an OrdImageSignature to be compared to signature1.
attrWeights - a String that specifies a list of one or more visual attributes and the weight to be applied to each attribute.
threshold - a float that specifies the degree of similarity required for the two images to be considered a match.
Returns:
an int value of 1 if the images match; otherwise, 0.
Throws:
java.sql.SQLException - if an error occurs calling the isSimilar method in the database.

evaluateScore

public static float evaluateScore(OrdImageSignature signature1,
OrdImageSignature signature2,
                                  java.lang.String attrWeights)
                           throws java.sql.SQLException
Description copied from class: OrdImageSignature
Compares two image signatures, returning a score that indicates the degree of difference between the image signatures. This method compares the image signatures in signature1 and signature2 using weights specified for one or more visual attributes. Returns a score between 0.0 and 100.0, where a lower value indicates a closer match.

Specify a weight in the range 0.0 to 1.0 for one or more of the following visual attributes:

You must specify a value greater than 0.0 for at least one of the following attributes: color, shape, or texture. The location attribute indicates the importance of the distribution of the color, shape or texture features in the images. During processing, the values are normalized such that they total 1.0.

For example, "color=0.7,shape=0.3".

Parameters:
signature1 - an OrdImageSignature.
signature2 - an OrdImageSignature to be compared to signature1.
attrWeights - a String that specifies a list of one or more visual attributes and the weight to be applied to each attribute.
Returns:
the score as a float.
Throws:
java.sql.SQLException - if an error occurs calling the evaluateScore method in the database.

isConnected

public boolean isConnected()
Description copied from interface: OrdDomainState
Determines whether the domain object has an internal JDBC connection to the database.
Specified by:
isConnected in interface OrdDomainState
Returns:
true if the there exists an internal JDBC connection; otherwise, returns false

getTierInfo

public int getTierInfo()
Description copied from interface: OrdDomainState
Gets the tier number information that this object lives in.

The returned value indicates the tier information.

Specified by:
getTierInfo in interface OrdDomainState

removeListenerFromTransaction

public void removeListenerFromTransaction()
Description copied from interface: OrdDomainState
Internal: Applications should not use this method.
Specified by:
removeListenerFromTransaction in interface OrdDomainState

setCTPassivationHandle

public void setCTPassivationHandle(java.lang.Object handle)
Internal: Applications should not use this method.
Specified by:
setCTPassivationHandle in interface OrdDomainSupportInterface

getCTPassivationHandle

public java.lang.Object getCTPassivationHandle()
Internal: Applications should not use this method.
Specified by:
getCTPassivationHandle in interface OrdDomainSupportInterface

prepareCTPassivation

public void prepareCTPassivation()
Internal: Applications should not use this method.
Specified by:
prepareCTPassivation in interface OrdDomainSupportInterface

Oracle9i Business Components for Java InterMedia API Reference
Oracle9i JDeveloper (9.0.4)
B10394-01

Copyright © 2001,2003, Oracle. All Rights Reserved.