de.unibi.techfak.jpredictor.clustering
Class VectorRelationMeasure

java.lang.Object
  extended by de.unibi.techfak.jpredictor.clustering.RelationMeasure
      extended by de.unibi.techfak.jpredictor.clustering.VectorRelationMeasure
All Implemented Interfaces:
Computable, java.lang.Comparable
Direct Known Subclasses:
LikelihoodMeasure, MinkowskiDistance

public abstract class VectorRelationMeasure
extends RelationMeasure

Superclass for all relations defined on two or more vectors. Vectors in this sense are e.g. nucleotides defined over the {A,C,G,T|U}, or amino acid occurrence counts of a multiple alignment. Or simply an array of numbers.


Field Summary
(package private)  java.util.Vector vectorList
          The list of vectors.
 
Fields inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure
computationResult
 
Fields inherited from interface de.unibi.techfak.jpredictor.clustering.Computable
COMPUTATION_FAILED, COMPUTATION_PENDING, COMPUTATION_SUCCESS, COMPUTATION_WAITING
 
Constructor Summary
VectorRelationMeasure()
           
 
Method Summary
 boolean add(double[] v, boolean clone)
          Adds a double array to the list of vectors.
 boolean add(int[] v)
          Adds an int array to the list of vectors.
 boolean add(java.util.Vector v)
          Adds a vector of numbers to the list of vectors.
 void clear()
          Empties the list of arrays in this class.
 int length()
          Returns the length of the last array added to this measure.
 
Methods inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure
atomicCombine, atomicCombine, atomicNormalize, compareTo, newInstance, optimum, optimum, result, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.unibi.techfak.jpredictor.clustering.Computable
compute
 

Field Detail

vectorList

java.util.Vector vectorList
The list of vectors. Every vector is added through a call to one of the add methods. The type of every vector is double[].

Constructor Detail

VectorRelationMeasure

public VectorRelationMeasure()
Method Detail

clear

public void clear()
Empties the list of arrays in this class. After invoking this method every call to compute() will fail. Nevertheless, the result is not cleared.


length

public int length()
Returns the length of the last array added to this measure.

Returns:
The length of the last array added to this class, -1 in case no array was added yet.

add

public boolean add(double[] v,
                   boolean clone)
Adds a double array to the list of vectors.

Parameters:
v - The array to be added.
clone - Whether or not the array is to be cloned.
Returns:
true if the array was added, false otherwise

add

public boolean add(java.util.Vector v)
Adds a vector of numbers to the list of vectors. The numbers will be converted to a double array. No Number should be null.

Parameters:
v - The vector of numbers be added.
Returns:
true if the array was added, false otherwise, e.g. if one Number was null or if one object was not a Number.

add

public boolean add(int[] v)
Adds an int array to the list of vectors. The numbers are converted to double beforehand.

Parameters:
v - The array to be added.
Returns:
true if the array was added, false otherwise.