it.amattioli.encapsulate.dates
Class Year

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.Year
All Implemented Interfaces:
TimeInterval, Discrete<Year>, Range<Date>, Serializable, Cloneable, Comparable<Year>

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

See Also:
Serialized Form

Constructor Summary
Year(Date date)
          Construct an object that represents the year containing the passed time point
Year(int year)
          Construct an year object given the year number.
 
Method Summary
 Object clone()
           
 int compareTo(Year y)
           
 boolean equals(Object o)
           
 Duration getDuration()
          Returns the duration of this time interval.
 Day getEndDay()
           
 Month getEndMonth()
           
 Date getEndTime()
          Returns the time point that is the end of this year
 Day getStartDay()
           
 Month getStartMonth()
           
 int getYear()
          Returns the year number.
 int hashCode()
           
 Collection<Month> months()
           
 Year next()
          Returns the year following this
 Year previous()
          Returns the year preceding this
static Year thisYear()
           
 DiscreteRange<Year> through(Year 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

Year

public Year(Date date)
Construct an object that represents the year containing the passed time point

Parameters:
date -

Year

public Year(int year)
Construct an year object given the year number.

Parameters:
year -
Method Detail

thisYear

public static Year thisYear()

getYear

public int getYear()
Returns the year number.

Returns:
l'anno

previous

public Year previous()
Returns the year preceding this

Specified by:
previous in interface Discrete<Year>
Specified by:
previous in class ConventionalTimeInterval
Returns:
the year preceding this

next

public Year next()
Returns the year following this

Specified by:
next in interface Discrete<Year>
Specified by:
next in class ConventionalTimeInterval
Returns:
the year following this

getEndTime

public Date getEndTime()
Returns the time point that is the end of this year

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

getStartDay

public Day getStartDay()

getEndDay

public Day getEndDay()

getStartMonth

public Month getStartMonth()

getEndMonth

public Month getEndMonth()

compareTo

public int compareTo(Year y)
Specified by:
compareTo in interface Comparable<Year>

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

months

public Collection<Month> months()

through

public DiscreteRange<Year> through(Year end)


Copyright © 2011. All Rights Reserved.