Interface CalendarFormattingSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to format and parse date times of the calendar and time type defined.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can format and parse date times.String[]datetimesToStrings(DateTimeList datetimes) Gets a string representation of a list of datetimes.datetimeToString(DateTime datetime) Gets a string representation of a datetime.String[]durationsToStrings(DurationList durations) Gets a string representation of a list of durations.durationToString(Duration duration) Gets a string representation of a duration.Gets the calendar type for the datetimes used in this session.Gets the date format type used in this session.Gets the time format type used in this session.Gets the time type for the times used in this session.Parses a date time string.Parses a duration string.Parses a time string.String[]timesToStrings(TimeList times) Gets a string representation of a list of times.timeToString(Time time) Gets a string representation of a time.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCalendarType
Type getCalendarType()Gets the calendar type for the datetimes used in this session.- Returns:
- the calendar type
- Compliance:
mandatory- This method must be implemented.
-
getTimeType
Type getTimeType()Gets the time type for the times used in this session.- Returns:
- the time type
- Compliance:
mandatory- This method must be implemented.
-
getDateFormatType
Type getDateFormatType()Gets the date format type used in this session.- Returns:
- the target language
- Compliance:
mandatory- This method must be implemented.
-
getTimeFormatType
Type getTimeFormatType()Gets the time format type used in this session.- Returns:
- the target script
- Compliance:
mandatory- This method must be implemented.
-
canDisplayPrimitives
boolean canDisplayPrimitives()Tests if this user can format and parse date times. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif translation methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
datetimeToString
String datetimeToString(DateTime datetime) throws OperationFailedException, PermissionDeniedException Gets a string representation of a datetime.- Parameters:
datetime- a datetime value- Returns:
- the display string
- Throws:
InvalidArgumentException-datetime.getCalendarType() != getCalendarType()ordatetime.getTimeType() != getTimeType()NullArgumentException-datetimeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
datetimesToStrings
String[] datetimesToStrings(DateTimeList datetimes) throws OperationFailedException, PermissionDeniedException Gets a string representation of a list of datetimes.- Parameters:
datetimes- a datetime value list- Returns:
- the display strings
- Throws:
InvalidArgumentException-datetime.getCalendarType() != getCalendarType()ordatetime.getTimeType() != getTimeType()NullArgumentException-datetimesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
stringToDateTime
Parses a date time string.- Parameters:
s- a datetime string- Returns:
- the date time value
- Throws:
InvalidArgumentException-sis not ofgetDateFormatType()orsis not ofgetTimeFormatType()NullArgumentException-sisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
timeToString
Gets a string representation of a time.- Parameters:
time- a time value- Returns:
- the display string
- Throws:
InvalidArgumentException-time.getTimeType() != getTimeType()NullArgumentException-timeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
timesToStrings
Gets a string representation of a list of times.- Parameters:
times- a time value list- Returns:
- the display strings
- Throws:
InvalidArgumentException-time.getTimeType()!=getTimeType()NullArgumentException-timesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
stringToTime
Parses a time string.- Parameters:
s- a time string- Returns:
- the time value
- Throws:
InvalidArgumentException-sis not ofgetTimeFormatType()NullArgumentException-sisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
durationToString
String durationToString(Duration duration) throws OperationFailedException, PermissionDeniedException Gets a string representation of a duration.- Parameters:
duration- a duration value- Returns:
- the display string
- Throws:
InvalidArgumentException-duration.getCalendarType() !=getCalendarType()orduration.getTimeType() != getTimeType()NullArgumentException-durationisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
durationsToStrings
String[] durationsToStrings(DurationList durations) throws OperationFailedException, PermissionDeniedException Gets a string representation of a list of durations.- Parameters:
durations- a duration value list- Returns:
- the display strings
- Throws:
InvalidArgumentException-duration.getCalendarType() !=getCalendarType()orduration.getTimeType() != getTimeType()NullArgumentException-durationsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
stringToDuration
Parses a duration string.- Parameters:
s- a duration string- Returns:
- the duration value
- Throws:
InvalidArgumentException-sis not ofgetDateFormatType()orsis not ofgetTimeFormatType()NullArgumentException-sisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-