ir.utilities
Class Weight

java.lang.Object
  |
  +--ir.utilities.Weight

public class Weight
extends java.lang.Object

A simple wrapper data structure for storing a double weight as an Object that can be put into lists, maps, etc. and then incremented, decremented, and set.


Field Summary
protected  double value
          A numerical weight value
 
Constructor Summary
Weight()
           
 
Method Summary
 double decrement()
          Decrement and return the new count
 double decrement(double n)
          Decrement by n and return the new count
 double decrement(int n)
          Decrement by n and return the new count
 double getValue()
          Get the current count
 double increment()
          Increment and return the new count
 double increment(double n)
          Increment by n and return the new count
 double increment(int n)
          Increment by n and return the new count
 double setValue(double value)
          Set the current count
 double setValue(int value)
          Set the current count
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected double value
A numerical weight value
Constructor Detail

Weight

public Weight()
Method Detail

increment

public double increment()
Increment and return the new count

increment

public double increment(int n)
Increment by n and return the new count

increment

public double increment(double n)
Increment by n and return the new count

decrement

public double decrement()
Decrement and return the new count

decrement

public double decrement(int n)
Decrement by n and return the new count

decrement

public double decrement(double n)
Decrement by n and return the new count

getValue

public double getValue()
Get the current count

setValue

public double setValue(int value)
Set the current count

setValue

public double setValue(double value)
Set the current count