OGS Java API Spec

ogs.core
Class Size

java.lang.Object
  |
  +--ogs.core.Size
All Implemented Interfaces:
Comparable

public class Size
extends Object
implements Comparable

The overall size of an entity falls into one of nine categories.


Field Summary
static char COLLOSAL
          As big as a tall building.
static char DIMINUITIVE
          Small enough to hold one in your hand.
static char FINE
          Small enough to hold dozens in one hand.
static char GARGANTUAN
          As big as a house.
static char HUGE
          As big as a tree.
static char LARGE
          Slightly larger than an average human.
static char MEDIUM
          Roughly the size of an average human.
static char SMALL
          Small enough to hold in both arms.
static char TINY
          Small enough to hold in both hands.
 
Constructor Summary
Size()
          Creates a medium entity size.
Size(char size)
          Creates a specified entity size.
 
Method Summary
 int compareTo(Object object)
          Compare this size to another size.
 int compareTo(Size s)
          Compare this size to another size.
 Modifier getModifier()
          Determine the modifier of the current size category.
 char getSize()
          Determine the current size category.
 void setSize(char size)
          Change the current size category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FINE

public static final char FINE
Small enough to hold dozens in one hand.

See Also:
Constant Field Values

DIMINUITIVE

public static final char DIMINUITIVE
Small enough to hold one in your hand.

See Also:
Constant Field Values

TINY

public static final char TINY
Small enough to hold in both hands. Roughly the size of a small animal.

See Also:
Constant Field Values

SMALL

public static final char SMALL
Small enough to hold in both arms. Roughly the size of a human child.

See Also:
Constant Field Values

MEDIUM

public static final char MEDIUM
Roughly the size of an average human.

See Also:
Constant Field Values

LARGE

public static final char LARGE
Slightly larger than an average human.

See Also:
Constant Field Values

HUGE

public static final char HUGE
As big as a tree.

See Also:
Constant Field Values

GARGANTUAN

public static final char GARGANTUAN
As big as a house.

See Also:
Constant Field Values

COLLOSAL

public static final char COLLOSAL
As big as a tall building.

See Also:
Constant Field Values
Constructor Detail

Size

public Size()
Creates a medium entity size.


Size

public Size(char size)
Creates a specified entity size.

Parameters:
size - One of the predefined sizes.
Method Detail

getSize

public char getSize()
Determine the current size category.

Returns:
One of the predefined sizes.

setSize

public void setSize(char size)
Change the current size category.

Parameters:
size - One of the predefined sizes.
Throws:
IllegalArgumentException - If size is invalid.

getModifier

public Modifier getModifier()
Determine the modifier of the current size category.

Returns:
modifier for the current size

compareTo

public int compareTo(Object object)
Compare this size to another size. Throws an exception if object is not a Size object.

Specified by:
compareTo in interface Comparable
Returns:
Negative if this size is smaller, zero if equal, or positive if larger

compareTo

public int compareTo(Size s)
Compare this size to another size.

Returns:
Negative if this size is smaller, zero if equal, or positive if larger

OGS Java API Spec