Package org.ojalgo.type.context
Class FormatContext<T>
- java.lang.Object
-
- org.ojalgo.type.context.FormatContext<T>
-
- All Implemented Interfaces:
TypeContext<T>
- Direct Known Subclasses:
BinaryContext
,BooleanContext
,DateContext
,GenericContext
,NumberContext
,StringContext
public abstract class FormatContext<T> extends java.lang.Object implements TypeContext<T>
Abstract base class for TypeContext implementations backed by Format.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
myConfigured
private java.text.Format
myFormat
static boolean
NBSP
Use 'Non-Breaking SPace' character instead of ardinary 'space' character.
-
Constructor Summary
Constructors Constructor Description FormatContext(java.text.Format format)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
configureFormat(java.text.Format format, java.lang.Object object)
(package private) java.text.Format
format()
java.lang.String
format(java.lang.Object object)
java.text.Format
getFormat()
protected abstract java.lang.String
handleFormatException(java.text.Format format, java.lang.Object object)
protected abstract T
handleParseException(java.text.Format format, java.lang.String string)
(package private) boolean
isConfigured()
T
parse(java.lang.CharSequence string)
<G> TypeContext<G>
withFormat(java.text.Format format)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.type.context.TypeContext
enforce
-
-
-
-
Field Detail
-
NBSP
public static final boolean NBSP
Use 'Non-Breaking SPace' character instead of ardinary 'space' character.- See Also:
- Constant Field Values
-
myConfigured
private boolean myConfigured
-
myFormat
private final java.text.Format myFormat
-
-
Method Detail
-
format
public final java.lang.String format(java.lang.Object object)
- Specified by:
format
in interfaceTypeContext<T>
- See Also:
TypeContext.format(java.lang.Object)
-
getFormat
public java.text.Format getFormat()
-
parse
public final T parse(java.lang.CharSequence string)
- Specified by:
parse
in interfaceTypeContext<T>
- See Also:
TypeContext.parse(CharSequence)
-
withFormat
public final <G> TypeContext<G> withFormat(java.text.Format format)
-
configureFormat
protected abstract void configureFormat(java.text.Format format, java.lang.Object object)
-
handleFormatException
protected abstract java.lang.String handleFormatException(java.text.Format format, java.lang.Object object)
-
handleParseException
protected abstract T handleParseException(java.text.Format format, java.lang.String string)
-
format
final java.text.Format format()
-
isConfigured
final boolean isConfigured()
-
-