jef.dna.util
Class Range

java.lang.Object
  extended by jef.dna.util.Range

public class Range
extends java.lang.Object

This class represents the concept of range, useful for representing the correct value an entity shoul conform to in a ValidationExceptionAncestor rooted class.

Author:
Francesco Russo

Constructor Summary
Range(int start, int end)
          Creates a new instance of Range
 
Method Summary
 int getEnd()
          Returns the last valid value of the range
 int getStart()
          Returns the first valid value of the range.
 void setEnd(int end)
          Sets the last valid value of the range
 void setStart(int start)
          Sets the first valid value of the range.
 java.lang.String toString()
          Returns a String representation of the current Range instance in the following form: [start, end].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range(int start,
             int end)
Creates a new instance of Range

Parameters:
start - The first value included in the range
end - The last value included in the range
Method Detail

getStart

public int getStart()
Returns the first valid value of the range.

Returns:
int The first valid value of the range

setStart

public void setStart(int start)
Sets the first valid value of the range.

Parameters:
start - The first valid value of the range

getEnd

public int getEnd()
Returns the last valid value of the range

Returns:
int The last valid value of the range

setEnd

public void setEnd(int end)
Sets the last valid value of the range

Parameters:
end - The last valid value of the range

toString

public java.lang.String toString()
Returns a String representation of the current Range instance in the following form: [start, end].

Overrides:
toString in class java.lang.Object
Returns:
String The String representation of the Range