it.amattioli.encapsulate.dates
Class ConventionalDuration

Show UML class diagram
java.lang.Object
  extended by it.amattioli.encapsulate.dates.ConventionalDuration
All Implemented Interfaces:
Duration

public class ConventionalDuration
extends Object
implements Duration


Nested Class Summary
static class ConventionalDuration.Type
           
 
Field Summary
static ConventionalDuration ONE_DAY
           
static ConventionalDuration ONE_MONTH
           
static ConventionalDuration ONE_WEEK
           
static ConventionalDuration ONE_YEAR
           
 
Constructor Summary
ConventionalDuration(ConventionalDuration.Type type, int amount)
           
ConventionalDuration(Day start, Day end)
           
ConventionalDuration(Month start, Month end)
           
ConventionalDuration(Year start, Year end)
           
 
Method Summary
 Date after(Date begin)
          Returns the time point obtained summing this duration to the given time point
 Date before(Date begin)
          Returns the time point obtained subtracting this duration to the given time point
 Duration plus(Duration d)
          Add this duration to another to obtain another duration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE_YEAR

public static final ConventionalDuration ONE_YEAR

ONE_MONTH

public static final ConventionalDuration ONE_MONTH

ONE_WEEK

public static final ConventionalDuration ONE_WEEK

ONE_DAY

public static final ConventionalDuration ONE_DAY
Constructor Detail

ConventionalDuration

public ConventionalDuration(ConventionalDuration.Type type,
                            int amount)

ConventionalDuration

public ConventionalDuration(Day start,
                            Day end)

ConventionalDuration

public ConventionalDuration(Month start,
                            Month end)

ConventionalDuration

public ConventionalDuration(Year start,
                            Year end)
Method Detail

after

public Date after(Date begin)
Description copied from interface: Duration
Returns the time point obtained summing this duration to the given time point

Specified by:
after in interface Duration
Returns:

before

public Date before(Date begin)
Description copied from interface: Duration
Returns the time point obtained subtracting this duration to the given time point

Specified by:
before in interface Duration
Returns:

plus

public Duration plus(Duration d)
Description copied from interface: Duration
Add this duration to another to obtain another duration.

Specified by:
plus in interface Duration
Returns:


Copyright © 2011. All Rights Reserved.