//Copyright (c) 2000-2003 San Diego Supercomputer Center (SDSC), //a facility operated by the University of California, San Diego (UCSD) // //Users and possessors of this source code are hereby granted a //nonexclusive, royalty-free copyright and design patent license to //use this code in individual software. License is not granted for //commercial resale, in whole or in part, without prior written //permission from SDSC. This source is provided "AS IS" without express //or implied warranty of any kind. // //For further information, please see: http://mbt.sdsc.edu // package edu.sdsc.mbt.util; import java.io.*; /** * This class implements a container for a range of two int values. * * @author Oleksandr V. Buzko */ public class IntRange implements Range, Serializable { private int start; private int end; /** * Constructor initialized with two values * @param a start int value * @param b end int value */ public IntRange(int a, int b){ start = a; end = b; } /** * Constructor creating an empty Range object * */ public IntRange(){ start = 0; end = 0; } /** * Sets start int value. * @param int value */ public void setStart (int a){ start = a; } /** * Sets end int value. * @param int value */ public void setEnd (int a){ end = a; } /** * Returns the start value. */ public int getStart(){ return start; } /** * Returns the end value. */ public int getEnd(){ return end; } /** * Returns a unit that indicates what type of range this is (an Integer) */ public Object getUnit(){ return new Integer(0); } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { out.defaultWriteObject(); } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { in.defaultReadObject(); } }