|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.basic.PartialTime
public final class PartialTime
A PartialTime
may represent a specific instant in time or a not yet fully specified
instance in time. That means every part (year, days, time zone ...) is optional.
Comparison of two PartialTime
's are only supported if at least one instance is fully
specified.
Comparison simply ignores positions with an asterix.
A comparison is always relative to a given TimeStamp
. This is due the fact that an
PartialTime
may be specified in local time.
Time: (*|YYYY)-(*|MM)-(*|DD)T(*|hh):(*|mm):(*|ss)
.
Zone: Z|([+-]hh:ss)
.
Examples:
Field Summary | |
---|---|
private int |
dayOfMonth
|
private org.joda.time.DateTimeZone |
defaultZone
|
(package private) boolean |
hasZone
|
private int |
hourOfDay
|
private boolean |
isYearAsterix
|
private int |
minuteOfHour
|
private int |
monthOfYear
|
private int |
secondOfMinute
|
private int |
year
|
private int[] |
zone
|
Constructor Summary | |
---|---|
PartialTime(boolean isYearAsterix,
int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
boolean hasZone,
int offsetHours,
int offsetMinutes,
org.joda.time.DateTimeZone defaultZone,
boolean allowWildcards)
Creates a new PartialTime with a default time zone. |
|
PartialTime(Date date)
Creates an PartialTime from a Date . |
|
PartialTime(String string,
org.joda.time.DateTimeZone defaultZone,
boolean allowWildcards)
Creates a new PartialTime from a string with a default time zone. |
Method Summary | |
---|---|
private void |
checkTimeAndOffset()
|
private int |
compareTo(PartialTime other,
TimeStamp timeStamp)
|
boolean |
equals(Object object)
|
int |
hashCode()
|
private boolean |
inLocalZone()
Returns true if this time is defined in local time zone. |
boolean |
inSameTimeZone(PartialTime other)
Returns true if this time is in the same time zone as other. |
boolean |
isAfter(PartialTime other,
TimeStamp timeStamp)
Return true if this time is after other time. |
boolean |
isBefore(PartialTime other,
TimeStamp timeStamp)
Return true if this time is before other time. |
boolean |
isComparableWith(PartialTime other)
Returns true if this and other are comparable. |
boolean |
isComplete()
Returns true if this time is complete defined and contains no asterix's. |
boolean |
isEqual(PartialTime other,
TimeStamp timeStamp)
Return true if this time is equal other time. |
private void |
parse(String string)
|
private void |
parseDateAndTime(String y,
String mo,
String d,
String h,
String mi,
String s)
|
private static int[] |
parseZone(String utc,
String sign,
String hours,
String minutes)
|
org.joda.time.DateTime |
toDateTime(TimeStamp timeStamp)
Returns this as DateTime . |
private org.joda.time.DateTimeZone |
toDateTimeZone(TimeStamp timeStamp)
|
String |
toString()
|
private String |
writePart(int i)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int year
private boolean isYearAsterix
private int monthOfYear
private int dayOfMonth
private int hourOfDay
private int minuteOfHour
private int secondOfMinute
private int[] zone
boolean hasZone
private org.joda.time.DateTimeZone defaultZone
Constructor Detail |
---|
public PartialTime(Date date)
PartialTime
from a Date
.
date
- a Date
.public PartialTime(String string, org.joda.time.DateTimeZone defaultZone, boolean allowWildcards) throws NumberFormatException
PartialTime
from a string with a default time zone. The default zone
may be null and therefore the local time zone at evaluation time is taken.
string
- see PartialTime
class description.defaultZone
- a default DateTimeZone
.
NumberFormatException
public PartialTime(boolean isYearAsterix, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, boolean hasZone, int offsetHours, int offsetMinutes, org.joda.time.DateTimeZone defaultZone, boolean allowWildcards)
PartialTime
with a default time zone. The default zone
may be null and therefore the local time zone at evaluation time is used.
year
- the year.monthOfYear
- the month of year.dayOfMonth
- the day of month.hourOfDay
- the hour of date.minuteOfHour
- the minute of hour.secondOfMinute
- the second of minute.defaultZone
- a default DateTimeZone
.Method Detail |
---|
public boolean isComplete()
private boolean inLocalZone()
public boolean inSameTimeZone(PartialTime other)
public org.joda.time.DateTime toDateTime(TimeStamp timeStamp)
DateTime
.
timeStamp
- a TimeStamp
.
DateTime
.public boolean isComparableWith(PartialTime other)
other
- an PartialTime
.
public boolean isAfter(PartialTime other, TimeStamp timeStamp)
other
- an PartialTime
.timeStamp
- evaluation time.public boolean isBefore(PartialTime other, TimeStamp timeStamp)
other
- an PartialTime
.timeStamp
- evaluation time.public boolean isEqual(PartialTime other, TimeStamp timeStamp)
other
- an PartialTime
.timeStamp
- evaluation time.private int compareTo(PartialTime other, TimeStamp timeStamp)
private void parse(String string)
private void parseDateAndTime(String y, String mo, String d, String h, String mi, String s)
private void checkTimeAndOffset()
private static int[] parseZone(String utc, String sign, String hours, String minutes)
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
private String writePart(int i)
private org.joda.time.DateTimeZone toDateTimeZone(TimeStamp timeStamp)
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:22
Copyright (c) 2002-2007 Ergon Informatik AG