fr.ifremer.isisfish.ui.widget
Class Interval

java.lang.Object
  extended by java.util.Observable
      extended by fr.ifremer.isisfish.ui.widget.Interval
All Implemented Interfaces:
Serializable, Cloneable

public class Interval
extends Observable
implements Serializable, Cloneable

Classe permettant de d'ecrire un interval. Cette interval est un peu particulier car il est circulaire. Par exemple si min=0, max=100, first=75 et bien last peut etre egal à 25 donc inferieur a first. Dans ce cas si l'on demande contains 50 il repond faux et contains 99 retourne vrai. Created: Wed Oct 4 2000

Version:
$Revision: 3400 $ Mise a jour: $Date: 2011-06-15 11:46:39 +0200 (Wed, 15 Jun 2011) $ par : $Author: chatellier $
Author:
POUSSIN Benjamin Copyright COGITEC
See Also:
Serialized Form

Nested Class Summary
static class Interval.IntervalIterator
           
 
Constructor Summary
Interval()
           
Interval(int first, int last)
           
Interval(int min, int max, int first, int last)
           
 
Method Summary
 Interval clone()
           
 boolean contains(int integerToCheck)
          Retourne vrai si l'entier est dans l'interval.
 boolean equals(Object o)
          Method equals
 int getFirst()
          Get the value of first.
 int getLast()
          Get the value of last.
 int getMax()
          Retourne le nombre maximal que peut prendre comme valeur cette interval.
 int getMin()
          Retourne le nombre minimal que peut prendre comme valeur cette interval.
 int getNbElem()
           
 Iterator<Integer> iterator()
           
 void move(int decal)
          Move.
 void setFirst(int v)
          Set the value of first.
 void setLast(int v)
          Set the value of last.
 void setMax(int max)
           
 void setMin(int min)
           
 String toString()
           
 String toXML()
          Deprecated. since 20090414 (unused)
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Interval

public Interval(int min,
                int max,
                int first,
                int last)

Interval

public Interval(int first,
                int last)

Interval

public Interval()
Method Detail

getMin

public int getMin()
Retourne le nombre minimal que peut prendre comme valeur cette interval.

Returns:
interval minimal value

setMin

public void setMin(int min)

getMax

public int getMax()
Retourne le nombre maximal que peut prendre comme valeur cette interval.

Returns:
interval maximal value

setMax

public void setMax(int max)

getFirst

public int getFirst()
Get the value of first.

Returns:
Value of first.

setFirst

public void setFirst(int v)
Set the value of first.

Parameters:
v - Value to assign to first.

getLast

public int getLast()
Get the value of last.

Returns:
Value of last.

setLast

public void setLast(int v)
Set the value of last.

Parameters:
v - Value to assign to last.

move

public void move(int decal)
Move.

Parameters:
decal - decal to move

contains

public boolean contains(int integerToCheck)
Retourne vrai si l'entier est dans l'interval.

Parameters:
integerToCheck - integer to check
Returns:
true if integerToCheck is in interval

getNbElem

public int getNbElem()
Returns:
le nombre d'element de l'interval

toString

public String toString()
Overrides:
toString in class Object

toXML

public String toXML()
Deprecated. since 20090414 (unused)

Retourne une chaine XML qui represente l'objet.

Returns:
interval representation as xml

iterator

public Iterator<Integer> iterator()
Returns:
une iteration

equals

public boolean equals(Object o)
Method equals

Overrides:
equals in class Object
Parameters:
o -
Returns:
boolean true if o is equal

clone

public Interval clone()
Overrides:
clone in class Object


Copyright © 1999-2012 CodeLutin. All Rights Reserved.