org.opensha.commons.data
Class ValueWeight

java.lang.Object
  extended by org.opensha.commons.data.ValueWeight

public class ValueWeight
extends Object

ValueWeight : This class allows to have a value and a weight can be assigned to that value. for example: A rupture rate can be assigned and we can assign a weight to that value of rate

Author:
vipingupta

Constructor Summary
ValueWeight()
          Default constructor
ValueWeight(double value, double weight)
          Set the value and weight
 
Method Summary
 Object clone()
          clone
 int compareTo(Object obj)
          Compares the values to if this is less than, equal to, or greater than the comparing objects.
 double getValue()
          Get value
 double getWeight()
          Get weight
 void setValue(double value)
          Set value
 void setWeight(double weight)
          Set weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueWeight

public ValueWeight()
Default constructor


ValueWeight

public ValueWeight(double value,
                   double weight)
Set the value and weight

Parameters:
value -
weight -
Method Detail

getValue

public double getValue()
Get value

Returns:

setValue

public void setValue(double value)
Set value

Parameters:
value -

getWeight

public double getWeight()
Get weight

Returns:

setWeight

public void setWeight(double weight)
Set weight

Parameters:
weight -

clone

public Object clone()
clone

Overrides:
clone in class Object

compareTo

public int compareTo(Object obj)
              throws ClassCastException
Compares the values to if this is less than, equal to, or greater than the comparing objects. Weight is irrelevant in this case

Parameters:
obj - The object to compare this to
Returns:
-1 if this value < obj value, 0 if equal, +1 if this value > obj value
Throws:
ClassCastException - Is thrown if the comparing object is not a ValueWeight.