Package org.ojalgo.type.context
Class GenericContext<T>
- java.lang.Object
-
- org.ojalgo.type.context.FormatContext<T>
-
- org.ojalgo.type.context.GenericContext<T>
-
- All Implemented Interfaces:
TypeContext<T>
public final class GenericContext<T> extends FormatContext<T>
-
-
Field Summary
Fields Modifier and Type Field Description private TypeContext<T>
myDelegate
-
Fields inherited from class org.ojalgo.type.context.FormatContext
NBSP
-
-
Constructor Summary
Constructors Constructor Description GenericContext(java.text.Format format)
GenericContext(TypeContext<?> delegate, java.text.Format format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureFormat(java.text.Format format, java.lang.Object object)
T
enforce(T object)
Will force the object to conform to the context's specification.protected java.lang.String
handleFormatException(java.text.Format format, java.lang.Object object)
protected T
handleParseException(java.text.Format format, java.lang.String string)
-
Methods inherited from class org.ojalgo.type.context.FormatContext
format, format, getFormat, isConfigured, parse, withFormat
-
-
-
-
Field Detail
-
myDelegate
private final TypeContext<T> myDelegate
-
-
Constructor Detail
-
GenericContext
public GenericContext(java.text.Format format)
-
GenericContext
GenericContext(TypeContext<?> delegate, java.text.Format format)
-
-
Method Detail
-
enforce
public T enforce(T object)
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).
-
configureFormat
protected void configureFormat(java.text.Format format, java.lang.Object object)
- Specified by:
configureFormat
in classFormatContext<T>
-
handleFormatException
protected java.lang.String handleFormatException(java.text.Format format, java.lang.Object object)
- Specified by:
handleFormatException
in classFormatContext<T>
-
handleParseException
protected T handleParseException(java.text.Format format, java.lang.String string)
- Specified by:
handleParseException
in classFormatContext<T>
-
-