de.fzi.kadmos.api
Class ForwardingCorrespondence<T extends OWLEntity>

java.lang.Object
  extended by de.fzi.kadmos.api.ForwardingCorrespondence<T>
Type Parameters:
T - Type of corresponding entities.
All Implemented Interfaces:
Correspondence<T>, Evaluable, Serializable, Cloneable

public abstract class ForwardingCorrespondence<T extends OWLEntity>
extends Object
implements Correspondence<T>, Serializable

Abstract wrapper class for an Correspondence following the Decorator pattern. The class can be extended and additional functionality can be added without accidentally changing the behaviour of the wrapped alignment implementation.

Note that the class is serialisable, thus extending classes must take care of proper serialisation and deserialisation of extra fields added. Care must also be taken if the wrapped alignment is not serialisable.

Extending classes should override equals as follows:

 public boolean equals( Object other ) {
      if( !(other instanceof MyExtension) )
           return false;
      MyExtension otherAlignment = (MyExtension) other;
      return super.equals( otherAlignment.alignment ) && ...
 }
 
where ... is supposed to perform additional checks regarding the extension.

Extending classes should not forget to override the hashCode function and the clone function.

Since:
1.0.0
Version:
1.3.0
Author:
Juergen Bock
See Also:
Serialized Form

Field Summary
protected  Correspondence<? extends OWLEntity> correspondence
          Wrapped correspondence object.
 
Constructor Summary
protected ForwardingCorrespondence(Correspondence<? extends OWLEntity> corr)
          Creates a new instance that wraps another correspondence.
 
Method Summary
 ForwardingCorrespondence<T> clone()
          Creates a clone of this correspondence.
 boolean equals(Object other)
           
 double getConfidence()
          Gets the confidence of this correspondence.
 T getEntity1()
          Gets the first entity of this correspondence.
 T getEntity2()
          Gets the second entity of this correspondence.
 int hashCode()
           
 void setConfidence(double confidence)
          Sets the confidence of this correspondence.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

correspondence

protected Correspondence<? extends OWLEntity> correspondence
Wrapped correspondence object.

Constructor Detail

ForwardingCorrespondence

protected ForwardingCorrespondence(Correspondence<? extends OWLEntity> corr)
Creates a new instance that wraps another correspondence.

Parameters:
corr - The correspondence to be wrapped by this object.
Since:
1.3.0
Method Detail

clone

public ForwardingCorrespondence<T> clone()
Description copied from interface: Correspondence
Creates a clone of this correspondence.

Specified by:
clone in interface Correspondence<T extends OWLEntity>
Overrides:
clone in class Object
Returns:
Clone of this correspondence.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getConfidence

public double getConfidence()
Description copied from interface: Correspondence
Gets the confidence of this correspondence. The confidence is a value between 0 and 1.

Specified by:
getConfidence in interface Correspondence<T extends OWLEntity>
Returns:
The confidence value.

getEntity1

public T getEntity1()
Description copied from interface: Correspondence
Gets the first entity of this correspondence.

Specified by:
getEntity1 in interface Correspondence<T extends OWLEntity>
Returns:
Entity 1.

getEntity2

public T getEntity2()
Description copied from interface: Correspondence
Gets the second entity of this correspondence.

Specified by:
getEntity2 in interface Correspondence<T extends OWLEntity>
Returns:
Entity 2.

setConfidence

public void setConfidence(double confidence)
Description copied from interface: Correspondence
Sets the confidence of this correspondence. Values greater than 1 will be set to 1, values less than 0 will be set to 0.

Specified by:
setConfidence in interface Correspondence<T extends OWLEntity>
Parameters:
confidence - The confidence value.


Copyright © 2012. All Rights Reserved.