net.sf.freecol.client.gui.i18n
Class Relation

java.lang.Object
  extended by net.sf.freecol.client.gui.i18n.Relation

public class Relation
extends java.lang.Object


Field Summary
(package private)  int high
           
(package private)  boolean integer
           
(package private)  int low
           
(package private)  int mod
           
(package private)  boolean negated
           
 
Constructor Summary
Relation(int low, int high)
           
Relation(java.util.List<java.lang.String> tokens)
           
 
Method Summary
 boolean matches(double number)
          Returns true if the given number matches this relation.
private  void parse(java.util.List<java.lang.String> input)
          Parses a list of string tokens.
 void setInteger(boolean value)
          Determines whether this relation only matches integers (defaults to true).
 void setMod(int mod)
          Sets the divisor for a modulo operation (defaults to 1).
 void setNegated(boolean value)
          Negates the return value of the relation (defaults to false).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

low

int low

high

int high

mod

int mod

negated

boolean negated

integer

boolean integer
Constructor Detail

Relation

public Relation(java.util.List<java.lang.String> tokens)

Relation

public Relation(int low,
                int high)
Method Detail

setMod

public void setMod(int mod)
Sets the divisor for a modulo operation (defaults to 1).

Parameters:
mod - an int value

setNegated

public void setNegated(boolean value)
Negates the return value of the relation (defaults to false).

Parameters:
value - a boolean value

setInteger

public void setInteger(boolean value)
Determines whether this relation only matches integers (defaults to true).

Parameters:
value - a boolean value

matches

public boolean matches(double number)
Returns true if the given number matches this relation.

Parameters:
number - a double value
Returns:
a boolean value

toString

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

parse

private void parse(java.util.List<java.lang.String> input)
Parses a list of string tokens.

Parameters:
input - a list of string tokens