|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.crypto.Validity
public class Validity
Describes the validity period of something by defining a start date (valid from) and an end date (valid to). The validity can then be tested for a given date.
| Field Summary | |
|---|---|
private java.util.Calendar |
m_validFrom
|
private java.util.Calendar |
m_validTo
|
private static int |
TEMPORARY_VALIDITY_IN_MINUTES
This is the minimal time (in minutes) for a validity created by createValidTo(). |
| Constructor Summary | |
|---|---|
Validity(java.util.Calendar a_validFrom,
java.util.Calendar a_validTo)
Creates a new Validity. |
|
Validity(java.util.Calendar a_validFrom,
int a_validityInYears)
Creates a new Validity. |
|
| Method Summary | |
|---|---|
private static java.util.Calendar |
createValidTo(java.util.Calendar a_validFrom,
int a_validityInYears)
For a given Calendar object that represents a start date (valid from), this method creates an end date (valid to) that lies a specified amount of years ahead from the start date. |
java.util.Date |
getValidFrom()
Returns the first valid date in the validity period. |
java.util.Date |
getValidTo()
Returns the last valid date in the validity period. |
boolean |
isValid(java.util.Date a_date)
Checks if the given date is contained in the validity period. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.Calendar m_validFrom
private java.util.Calendar m_validTo
private static final int TEMPORARY_VALIDITY_IN_MINUTES
| Constructor Detail |
|---|
public Validity(java.util.Calendar a_validFrom,
int a_validityInYears)
a_validFrom - a Calendar object that represents a start datea_validityInYears - an amount of years that the created date should lie ahead from the
start date; if the amount is less than 0 the created date will
only be ahead from the start date for a very small time
(some minutes)
java.lang.IllegalArgumentException - if the calendar is null
public Validity(java.util.Calendar a_validFrom,
java.util.Calendar a_validTo)
a_validFrom - a Calendar object that represents a start datea_validTo - a Calendar object that represents a end date; if the date lies before
the start date it will be set equal to the start date
java.lang.IllegalArgumentException - if on of the calendars is null| Method Detail |
|---|
public java.util.Date getValidFrom()
public java.util.Date getValidTo()
public boolean isValid(java.util.Date a_date)
a_date - a Date
private static java.util.Calendar createValidTo(java.util.Calendar a_validFrom,
int a_validityInYears)
a_validFrom - a Calendar object that represents a start datea_validityInYears - an amount of years that the created date should lie ahead from the
start date; if the amount is less than 0 the created date will
only be ahead from the start date for a very small time
(some minutes)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||