Package org.ojalgo.type.context
Class StringContext
- java.lang.Object
-
- org.ojalgo.type.context.FormatContext<java.lang.String>
-
- org.ojalgo.type.context.StringContext
-
- All Implemented Interfaces:
TypeContext<java.lang.String>
public final class StringContext extends FormatContext<java.lang.String>
StringContext
-
-
Field Summary
Fields Modifier and Type Field Description private static java.text.Format
DEFAULT_FORMAT
private int
myLength
-
Fields inherited from class org.ojalgo.type.context.FormatContext
NBSP
-
-
Constructor Summary
Constructors Modifier Constructor Description StringContext()
StringContext(int length)
private
StringContext(java.text.Format format)
StringContext(java.text.Format format, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureFormat(java.text.Format format, java.lang.Object object)
java.lang.String
enforce(java.lang.String 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 java.lang.String
handleParseException(java.text.Format format, java.lang.String string)
-
Methods inherited from class org.ojalgo.type.context.FormatContext
format, format, getFormat, isConfigured, parse, withFormat
-
-
-
-
Method Detail
-
enforce
public java.lang.String enforce(java.lang.String 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<java.lang.String>
-
handleFormatException
protected java.lang.String handleFormatException(java.text.Format format, java.lang.Object object)
- Specified by:
handleFormatException
in classFormatContext<java.lang.String>
-
handleParseException
protected java.lang.String handleParseException(java.text.Format format, java.lang.String string)
- Specified by:
handleParseException
in classFormatContext<java.lang.String>
-
-