org.rlcommunity.rlglue.codec.taskspec.ranges
Class IntRange

java.lang.Object
  extended by org.rlcommunity.rlglue.codec.taskspec.ranges.AbstractRange
      extended by org.rlcommunity.rlglue.codec.taskspec.ranges.IntRange

public class IntRange
extends AbstractRange

Author:
Brian Tanner

Field Summary
 
Fields inherited from class org.rlcommunity.rlglue.codec.taskspec.ranges.AbstractRange
specialValues
 
Constructor Summary
IntRange()
          Constructs an unknown to unknown IntRange
IntRange(int howMany)
          Constructs a set of howMany unknown to unknown IntRange
IntRange(int min, int max)
          Constructs a min to max IntRange
IntRange(int min, int max, int howMany)
          Constructs a set of howMany min to max IntRange
IntRange(java.lang.String thisRange)
          This should be a 2 or 3 tuple range like "1 2" or "5 1 2"
 
Method Summary
 int getMax()
           
 java.lang.String getMaxAsString()
          Override this is descendant classes and only use super method if max is special.
 int getMin()
           
 java.lang.String getMinAsString()
          Override this is descendant classes and only use super method if min is special.
 int getRangeSize()
          Return the size of the range.
protected  void parseMax(java.lang.String highPart)
           
protected  void parseMin(java.lang.String lowPart)
           
 void setMax(int newMax)
           
 void setMin(int newMin)
           
 java.lang.String toString()
           
 
Methods inherited from class org.rlcommunity.rlglue.codec.taskspec.ranges.AbstractRange
getHowMany, getMaxInf, getMaxNegInf, getMaxSpecialStatus, getMaxUnspecified, getMinInf, getMinNegInf, getMinSpecialStatus, getMinUnspecified, hasSpecialMaxStatus, hasSpecialMinStatus, parseSpecialMax, parseSpecialMin, setMaxInf, setMaxSpecified, setMaxUnspecified, setMinNegInf, setMinSpecified, setMinUnspecified, toTaskSpec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntRange

public IntRange()
Constructs an unknown to unknown IntRange


IntRange

public IntRange(int howMany)
Constructs a set of howMany unknown to unknown IntRange


IntRange

public IntRange(java.lang.String thisRange)
This should be a 2 or 3 tuple range like "1 2" or "5 1 2"

Parameters:
thisRange -

IntRange

public IntRange(int min,
                int max)
Constructs a min to max IntRange


IntRange

public IntRange(int min,
                int max,
                int howMany)
Constructs a set of howMany min to max IntRange

Method Detail

getRangeSize

public int getRangeSize()
Return the size of the range. So, if the range was [0,0], the range size is 1. If it is [0,9], the range size is 10, etc. Good for determining for big of an array you need to hold all possible values. Behavior is undefined if min or max has a special value.

Returns:
The size of the range (max-min+1) if neither is a special value (NEGINF, UNSPEC, etc)

getMin

public int getMin()

getMax

public int getMax()

setMax

public void setMax(int newMax)

setMin

public void setMin(int newMin)

parseMin

protected void parseMin(java.lang.String lowPart)
Specified by:
parseMin in class AbstractRange

parseMax

protected void parseMax(java.lang.String highPart)
Specified by:
parseMax in class AbstractRange

getMinAsString

public java.lang.String getMinAsString()
Description copied from class: AbstractRange
Override this is descendant classes and only use super method if min is special.

Overrides:
getMinAsString in class AbstractRange
Returns:
The minimum value special status as a string (one of NEGINF, POSINF, UNSPEC, NONE

getMaxAsString

public java.lang.String getMaxAsString()
Description copied from class: AbstractRange
Override this is descendant classes and only use super method if max is special.

Overrides:
getMaxAsString in class AbstractRange
Returns:
The maximum value special status as a string (one of NEGINF, POSINF, UNSPEC, NONE

toString

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