serf.data
Class PriceMatcher

java.lang.Object
  extended by serf.data.PriceMatcher
All Implemented Interfaces:
AtomicMatch

public class PriceMatcher
extends java.lang.Object
implements AtomicMatch

Compares two prices


Constructor Summary
PriceMatcher()
           
PriceMatcher(float thresh)
           
 
Method Summary
 boolean valuesMatch(java.lang.String s1, java.lang.String s2)
          Compare two prices.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriceMatcher

public PriceMatcher(float thresh)

PriceMatcher

public PriceMatcher()
Method Detail

valuesMatch

public boolean valuesMatch(java.lang.String s1,
                           java.lang.String s2)
Compare two prices. Note: While both parameters are of type String, their values should be a sequence of characters that represnt floating point numbers (e.g "1.20").

Specified by:
valuesMatch in interface AtomicMatch
Parameters:
s1 - price 1
s2 - price 2
Returns:
true if min_price/max_price > threshold (threshold defaults to 0.33)