oracle.panama.mp.privacy
Class AuthPeriod
java.lang.Object
|
+--oracle.panama.mp.privacy.AuthPeriod
- public class AuthPeriod
- extends java.lang.Object
AuthPeriod keeps a time range which is used when a user grants the positioning right to other users. An authorization period is composed of start date, end date, start time, end time and exclusions. The class also provides a method contains
to check whether specific time falls in the time range represented by the AuthPeriod object.
- Author:
- jiwu
Constructor Summary |
AuthPeriod(java.util.Calendar startD, java.util.Calendar endD, java.util.Calendar startT, java.util.Calendar endT, int excl)
Construct an AuthPeriod which starts from a start day (startD ), ends on a ending day (endD ) and for each day, starts from start time (startT and ends at ending time (endT ). |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
MONDAY
public static final byte MONDAY
-
- See Also:
- Constant Field Values
TUESDAY
public static final byte TUESDAY
-
- See Also:
- Constant Field Values
WEDNESDAY
public static final byte WEDNESDAY
-
- See Also:
- Constant Field Values
THURSDAY
public static final byte THURSDAY
-
- See Also:
- Constant Field Values
FRIDAY
public static final byte FRIDAY
-
- See Also:
- Constant Field Values
SATURDAY
public static final byte SATURDAY
-
- See Also:
- Constant Field Values
SUNDAY
public static final byte SUNDAY
-
- See Also:
- Constant Field Values
ALL_THE_TIME
public static final AuthPeriod ALL_THE_TIME
NEVER
public static final AuthPeriod NEVER
AuthPeriod
public AuthPeriod(java.util.Calendar startD,
java.util.Calendar endD,
java.util.Calendar startT,
java.util.Calendar endT,
int excl)
- Construct an AuthPeriod which starts from a start day (
startD
), ends on a ending day (endD
) and for each day, starts from start time (startT
and ends at ending time (endT
). startT and endT are with the accuracy of minute. To represent a full day, the startT should be set to 00:00 and the endT should be set to 23:59 The excl specifies the days of the week which are excluded from the period. For example to contruct an AnthPeriod which represents the period: from June 15,2001 to July 15, 2001, each day from 9:00am to 5:00pm and excluding Weekends, startD
shoud be set to June 15,2001 endD
should be set to July 15,2001 startT
should be set to 9:00am endT
should be set to 5:00pm excl
should be set to AuthPeriod.SATURDAY | AuthPeriod.SUNDAY
- Parameters:
startD
- the starting date(inclusive). If startD is null, today's date is used
endD
- the ending date(inclusive). If endD is null, today's date is used
startT
- the starting time on each day (inclusive). If the startT is null, current time is used.
endT
- the ending time on each day (inclusive). If the endT is null, current time is used.
excl
- The exclusions.
getStartDate
public java.util.Calendar getStartDate()
getEndDate
public java.util.Calendar getEndDate()
getStartTime
public java.util.Calendar getStartTime()
getEndTime
public java.util.Calendar getEndTime()
getExclusion
public byte getExclusion()
equals
public boolean equals(java.lang.Object obj)
-
- Overrides:
equals
in class java.lang.Object
contains
public boolean contains(java.util.Calendar posTime)
- This method is used to check whether the posTime falls in this AuthPeriod
-
- Parameters:
posTime
- time to be checked
- Returns:
- if the posTime falls in the period, returns true, otherwise, false is returned.
toString
public java.lang.String toString()
-
- Overrides:
toString
in class java.lang.Object
getNextTimeWithinPeriod
public java.util.Calendar getNextTimeWithinPeriod(java.util.Calendar now)
isEnabled
public boolean isEnabled()
Copyright © 2003 Oracle Corporation. All Rights Reserved.