net.sf.taverna.t2.partition.algorithms
Class LiteralValuePartitionAlgorithm

java.lang.Object
  extended by net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm
All Implemented Interfaces:
PartitionAlgorithm<java.lang.Object>

public class LiteralValuePartitionAlgorithm
extends java.lang.Object
implements PartitionAlgorithm<java.lang.Object>

A naive partition algorithm that simply returns the property value it's been configured to use from the property getter.

Author:
Tom

Constructor Summary
LiteralValuePartitionAlgorithm()
          Default constructor.
LiteralValuePartitionAlgorithm(java.lang.String propertyName)
          Constructor that initialised the LiteralValuePartitionAlgorithm with a property name
 
Method Summary
 java.lang.Object allocate(java.lang.Object newItem, PropertyExtractorRegistry reg)
          Given an object to classify return the value of the partition into which the object falls.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getPropertyName()
           
 int hashCode()
           
 void setPropertyName(java.lang.String propertyName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiteralValuePartitionAlgorithm

public LiteralValuePartitionAlgorithm()
Default constructor. The property name defaults to null, and needs setting using getPropertyName


LiteralValuePartitionAlgorithm

public LiteralValuePartitionAlgorithm(java.lang.String propertyName)
Constructor that initialised the LiteralValuePartitionAlgorithm with a property name

Parameters:
propertyName -
Method Detail

allocate

public java.lang.Object allocate(java.lang.Object newItem,
                                 PropertyExtractorRegistry reg)
Description copied from interface: PartitionAlgorithm
Given an object to classify return the value of the partition into which the object falls.

Specified by:
allocate in interface PartitionAlgorithm<java.lang.Object>
Returns:

getPropertyName

public java.lang.String getPropertyName()

setPropertyName

public void setPropertyName(java.lang.String propertyName)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Returns:
true if obj is a LiteralValuePartionAlgorithm and the property names match

hashCode

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

toString

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