prog.utili
Enum MeseDellAnno

java.lang.Object
  extended by java.lang.Enum<MeseDellAnno>
      extended by prog.utili.MeseDellAnno
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MeseDellAnno>

public enum MeseDellAnno
extends java.lang.Enum<MeseDellAnno>

Gli oggetti di questo tipo enumerativo rappresentano i mesi dell'anno.

Version:
2.0
Author:
Mauro Ferrari, Giovanni Pighizzini

Enum Constant Summary
AGOSTO
           
APRILE
           
DICEMBRE
           
FEBBRAIO
           
GENNAIO
           
GIUGNO
           
LUGLIO
           
MAGGIO
           
MARZO
           
NOVEMBRE
           
OTTOBRE
           
SETTEMBRE
           
 
Method Summary
static MeseDellAnno getMese(Data d)
          Restituisce il MeseDellAnno corrispondente alla data specificata come argomento.
static MeseDellAnno getMese(int m)
          Restituisce il MeseDellAnno corrispondente al numero specificato come argomento.
 int numeroGiorni()
          Restituisce il numero dei giorni del mese (28 se l'oggetto che esegue il metodo è FEBBRAIO).
 int numeroGiorni(boolean bisestile)
          Restituisce il numero dei giorni del mese; nel caso di febbraio, se l'argomento è true restituisce 29, se è false restituisce 28.
 int numeroGiorni(int anno)
          Restituisce il numero dei giorni del mese, relativamente all'anno specificato come argomento.
 MeseDellAnno precedente()
          Restituisce il riferimento all'oggetto che rappresenta il mese precedente a quello che esegue il metodo.
 MeseDellAnno successivo()
          Restituisce il riferimento all'oggetto che rappresenta il mese successivo a quello che esegue il metodo.
 java.lang.String toString()
           
static MeseDellAnno valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static MeseDellAnno[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GENNAIO

public static final MeseDellAnno GENNAIO

FEBBRAIO

public static final MeseDellAnno FEBBRAIO

MARZO

public static final MeseDellAnno MARZO

APRILE

public static final MeseDellAnno APRILE

MAGGIO

public static final MeseDellAnno MAGGIO

GIUGNO

public static final MeseDellAnno GIUGNO

LUGLIO

public static final MeseDellAnno LUGLIO

AGOSTO

public static final MeseDellAnno AGOSTO

SETTEMBRE

public static final MeseDellAnno SETTEMBRE

OTTOBRE

public static final MeseDellAnno OTTOBRE

NOVEMBRE

public static final MeseDellAnno NOVEMBRE

DICEMBRE

public static final MeseDellAnno DICEMBRE
Method Detail

values

public static final MeseDellAnno[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(MeseDellAnno c : MeseDellAnno.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static MeseDellAnno valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

numeroGiorni

public int numeroGiorni()
Restituisce il numero dei giorni del mese (28 se l'oggetto che esegue il metodo è FEBBRAIO).

Returns:
il numero dei giorni del mese che esegue il metodo.

numeroGiorni

public int numeroGiorni(int anno)
Restituisce il numero dei giorni del mese, relativamente all'anno specificato come argomento. Pertanto, nel caso degli anni bisestili, per il mese di febbraio restituisce 29.

Parameters:
anno - l'anno rispetto al quale si vogliono determinare i giorni del mese.
Returns:
il numero dei giorni del mese che esegue il metodo.

numeroGiorni

public int numeroGiorni(boolean bisestile)
Restituisce il numero dei giorni del mese; nel caso di febbraio, se l'argomento è true restituisce 29, se è false restituisce 28.

Parameters:
bisestile - true per indicare che l'anno è bisestile.
Returns:
il numero dei giorni del mese che esegue il metodo.

successivo

public MeseDellAnno successivo()
Restituisce il riferimento all'oggetto che rappresenta il mese successivo a quello che esegue il metodo. L'oggetto successivo a DICEMBRE è quello corrispondente a GENNAIO.

Returns:
il riferimento al mese successivo a quello che esegue il metodo.

precedente

public MeseDellAnno precedente()
Restituisce il riferimento all'oggetto che rappresenta il mese precedente a quello che esegue il metodo. L'oggetto precedente a GENNAIO è quello corrispondente a DICEMBRE.

Returns:
il riferimento al mese precedente a quello che esegue il metodo.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<MeseDellAnno>

getMese

public static MeseDellAnno getMese(int m)
Restituisce il MeseDellAnno corrispondente al numero specificato come argomento.


getMese

public static MeseDellAnno getMese(Data d)
Restituisce il MeseDellAnno corrispondente alla data specificata come argomento.