it.amattioli.encapsulate.dates
Class Month

Show UML class diagram
java.lang.Object
  extended by it.amattioli.encapsulate.range.AbstractRange<T>
      extended by it.amattioli.encapsulate.range.ContinousRange<Date>
          extended by it.amattioli.encapsulate.dates.ConventionalTimeInterval
              extended by it.amattioli.encapsulate.dates.Month
All Implemented Interfaces:
TimeInterval, Discrete<Month>, Range<Date>, Serializable, Cloneable, Comparable<Month>

public class Month
extends ConventionalTimeInterval
implements Discrete<Month>, Serializable, Cloneable

Rappresenta un arco di tempo corrispondente ad un mese.

Author:
a.mattioli Creato il Jan 28, 2005 alle 10:16:18 PM
See Also:
Serialized Form

Constructor Summary
Month(Date date)
          Costruisce un oggetto che rappresenta il mese contenente la data passata come parametro.
Month(int month, int year)
          Costruisce un oggetto mese a partire dal mese e dall'anno.
 
Method Summary
 Object clone()
           
 int compareTo(Month m)
           
 Collection<Day> days()
           
 boolean equals(Object o)
           
 Duration getDuration()
          Returns the duration of this time interval.
 Day getEndDay()
           
 Date getEndTime()
          Restituisce l'istante di tempo finale di questo intervallo
 Week getFirstWeek()
          Restituisce la prima settimana che contenga almeno un giorno di questo mese
 Week getLastWeek()
          Restituisce l'ultima settimana che contenga almeno un giorno di questo mese
 int getMonth()
          Restituisce il mese dell'anno.
 Day getStartDay()
           
 int getYear()
          Restituisce l'anno a cui appartiene questo mese.
 int hashCode()
           
 Month next()
          Il mese successivo a questo.
 Month previous()
          Il mese precedente a questo.
static Month thisMonth()
           
 DiscreteRange<Month> through(Month end)
           
 String toString()
           
 
Methods inherited from class it.amattioli.encapsulate.dates.ConventionalTimeInterval
after, after, before, before, dayIterator, getCalendar, getHigh, getHighDay, getInitTime, getLow, getLowDay, getPhysicalDuration, includes, isHighBounded, isLowBounded, newRange, setCalendar
 
Methods inherited from class it.amattioli.encapsulate.range.ContinousRange
abutOn, gap, mergeWith, minus
 
Methods inherited from class it.amattioli.encapsulate.range.AbstractRange
contains, hasSameHigh, hasSameLow, intersect, overlaps
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.amattioli.encapsulate.range.Range
abutOn, contains, gap, hasSameHigh, hasSameLow, intersect, mergeWith, minus, overlaps
 

Constructor Detail

Month

public Month(Date date)
Costruisce un oggetto che rappresenta il mese contenente la data passata come parametro.

Parameters:
date - la data che dovrà appartenere al mese da costruire

Month

public Month(int month,
             int year)
Costruisce un oggetto mese a partire dal mese e dall'anno.

Parameters:
month - una delle costanti della classe Calendar che rappresentano il mese da costruire
year - l'anno del mese da costruire
Method Detail

thisMonth

public static Month thisMonth()

getMonth

public int getMonth()
Restituisce il mese dell'anno.

Returns:
il mese dell'anno come una delle costanti della classe Calendar che rappresentano un mese

getYear

public int getYear()
Restituisce l'anno a cui appartiene questo mese.

Returns:
l'anno a cui appartiene questo mese

previous

public Month previous()
Il mese precedente a questo.

Specified by:
previous in interface Discrete<Month>
Specified by:
previous in class ConventionalTimeInterval
Returns:
il mese precedente a questo

next

public Month next()
Il mese successivo a questo.

Specified by:
next in interface Discrete<Month>
Specified by:
next in class ConventionalTimeInterval
Returns:
il mese successivo a questo

getEndTime

public Date getEndTime()
Description copied from class: ConventionalTimeInterval
Restituisce l'istante di tempo finale di questo intervallo

Specified by:
getEndTime in class ConventionalTimeInterval
Returns:
l'istante di tempo finale di questo intervallo

getStartDay

public Day getStartDay()

getEndDay

public Day getEndDay()

getFirstWeek

public Week getFirstWeek()
Restituisce la prima settimana che contenga almeno un giorno di questo mese

Returns:

getLastWeek

public Week getLastWeek()
Restituisce l'ultima settimana che contenga almeno un giorno di questo mese

Returns:

compareTo

public int compareTo(Month m)
Specified by:
compareTo in interface Comparable<Month>

equals

public boolean equals(Object o)
Overrides:
equals in class AbstractRange<Date>

hashCode

public int hashCode()
Overrides:
hashCode in class ConventionalTimeInterval

clone

public Object clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class AbstractRange<Date>

getDuration

public Duration getDuration()
Description copied from interface: TimeInterval
Returns the duration of this time interval. This make sense only for a time interval that has both extremes, otherwise the duration is infinite.

Specified by:
getDuration in interface TimeInterval
Returns:
this time interval duration

days

public Collection<Day> days()

through

public DiscreteRange<Month> through(Month end)


Copyright © 2011. All Rights Reserved.