Package com.jgoodies.forms.layout
Class ConstantSize.Unit
java.lang.Object
com.jgoodies.forms.layout.ConstantSize.Unit
- All Implemented Interfaces:
Serializable
- Enclosing class:
ConstantSize
An ordinal-based serializable typesafe enumeration for units
as used in instances of
ConstantSize
.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the first character of this Unit's name.encode()
Returns a parseable string representation of this unit.private Object
toString()
Returns a string representation of this unit object.(package private) static ConstantSize.Unit
Returns a Unit that corresponds to the specified string.
-
Field Details
-
name
-
abbreviation
-
parseAbbreviation
-
requiresIntegers
final transient boolean requiresIntegers -
nextOrdinal
private static int nextOrdinal -
ordinal
private final int ordinal
-
-
Constructor Details
-
Unit
-
-
Method Details
-
valueOf
Returns a Unit that corresponds to the specified string.- Parameters:
name
- the encoded unit, trimmed and in lower casehorizontal
- true for a horizontal unit, false for vertical- Returns:
- the corresponding Unit
- Throws:
IllegalArgumentException
- if no Unit exists for the string
-
toString
Returns a string representation of this unit object. Note: This implementation may change at any time. It is intended for debugging purposes. For parsing, useencode()
instead. -
encode
Returns a parseable string representation of this unit.- Returns:
- a String that can be parsed by the Forms parser
- Since:
- 1.2
-
abbreviation
Returns the first character of this Unit's name. Used to identify it in short format strings.- Returns:
- the first character of this Unit's name.
-
readResolve
-