com.jgoodies.forms.layout
Class ConstantSize.Unit

java.lang.Object
  extended by com.jgoodies.forms.layout.ConstantSize.Unit
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
ConstantSize

public static final class ConstantSize.Unit
extends java.lang.Object
implements java.io.Serializable

An ordinal-based serializable typesafe enumeration for units as used in instances of ConstantSize.

See Also:
Serialized Form

Field Summary
private  java.lang.String abbreviation
           
private  java.lang.String name
           
private static int nextOrdinal
           
private  int ordinal
           
(package private)  boolean requiresIntegers
           
 
Constructor Summary
private ConstantSize.Unit(java.lang.String name, java.lang.String abbreviation, boolean requiresIntegers)
           
 
Method Summary
 java.lang.String abbreviation()
          Returns the first character of this Unit's name.
private  java.lang.Object readResolve()
           
 java.lang.String toString()
           
(package private) static ConstantSize.Unit valueOf(java.lang.String str, boolean horizontal)
          Returns an instance of Unit that corresponds to the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final transient java.lang.String name

abbreviation

private final transient java.lang.String abbreviation

requiresIntegers

final transient boolean requiresIntegers

nextOrdinal

private static int nextOrdinal

ordinal

private final int ordinal
Constructor Detail

ConstantSize.Unit

private ConstantSize.Unit(java.lang.String name,
                          java.lang.String abbreviation,
                          boolean requiresIntegers)
Method Detail

valueOf

static ConstantSize.Unit valueOf(java.lang.String str,
                                 boolean horizontal)
Returns an instance of Unit that corresponds to the specified string.

Parameters:
str - the encoded unit
horizontal - true for a horizontal unit, false for vertical
Returns:
the corresponding Unit
Throws:
java.lang.IllegalArgumentException - if no Unit exists for the string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

abbreviation

public java.lang.String 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

private java.lang.Object readResolve()