name.alessiosaltarin.utils
Class ValuedString

java.lang.Object
  extended by name.alessiosaltarin.utils.ValuedString

public class ValuedString
extends java.lang.Object

String with an associated value

Author:
Alessio Saltarin

Constructor Summary
ValuedString(java.lang.String name, short val)
          Constructor for ValuedString object
 
Method Summary
 int compareTo(java.lang.Object rv)
          Adds comparability Comparing is made on Value
 java.lang.String getName()
          Get name of this ValuedString
 short getValue()
          Get value of this ValuedString
 java.lang.String toString()
          Brief description of this ValuedString in the form Name (Value)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValuedString

public ValuedString(java.lang.String name,
                    short val)
Constructor for ValuedString object

Parameters:
name - Name of Object
val - Value of Object
Method Detail

getName

public java.lang.String getName()
Get name of this ValuedString

Returns:
name

getValue

public short getValue()
Get value of this ValuedString

Returns:
value

toString

public java.lang.String toString()
Brief description of this ValuedString in the form Name (Value)

Overrides:
toString in class java.lang.Object
Returns:
Description of this ValuedString in the form Name

compareTo

public int compareTo(java.lang.Object rv)
Adds comparability Comparing is made on Value

Parameters:
rv - Compared ValuedString
Returns:
0 if objects are equal (they have the same value). -1 if this object has minor cost that rv 1 if this object costs more than rv

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net