Package org.ojalgo.type.context
Class DateContext
- All Implemented Interfaces:
TypeContext<Date>
This
TypeContext
deals with the old Date
. There is another implementation that
tries to deal with the newer date time API – TemporalContext
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DatePart
private static final DateStyle
private final DatePart
private final DateStyle
Fields inherited from class org.ojalgo.type.context.FormatContext
NBSP
-
Constructor Summary
ConstructorsConstructorDescriptionDateContext
(DatePart part) DateContext
(DatePart part, DateStyle style, Locale locale) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureFormat
(Format format, Object object) Will force the object to conform to the context's specification.getPart()
getStyle()
getUnit()
protected String
handleFormatException
(Format format, Object object) protected Date
handleParseException
(Format format, String string) static Format
withFormat
(DatePart part, DateStyle style, Locale locale) Methods inherited from class org.ojalgo.type.context.FormatContext
format, format, getFormat, isConfigured, parse, withFormat
-
Field Details
-
DEFAULT_PART
-
DEFAULT_STYLE
-
myPart
-
myStyle
-
-
Constructor Details
-
DateContext
public DateContext() -
DateContext
-
DateContext
-
-
Method Details
-
toFormat
-
enforce
Description copied from interface:TypeContext
Will force the object to conform to the context's specification. The default implementation formats aString
and then parses that back to an object (of the original type). -
getPart
-
getStyle
-
getUnit
-
withFormat
-
configureFormat
- Specified by:
configureFormat
in classFormatContext<Date>
-
handleFormatException
- Specified by:
handleFormatException
in classFormatContext<Date>
-
handleParseException
- Specified by:
handleParseException
in classFormatContext<Date>
-