dip.order
Class OrderFormatOptions

java.lang.Object
  extended bydip.order.OrderFormatOptions
All Implemented Interfaces:
java.lang.Cloneable

public class OrderFormatOptions
extends java.lang.Object
implements java.lang.Cloneable

This object controls, in detail, how orders are formatted.

Several static methods for default order formats are supported. Remember that the static methods create mutable objects that can be modified.

Styles define how an order appears (e.g., upper case, lower case, none). Styles are applied after all formatting.

Formats define how an order is displayed.

Possessive Powers are the powers in Support and Convoy orders that can be displayed if supporting a unit that is of a different power.

Debug Mode displays full coasts, and null items with their type.


Field Summary
static java.lang.String ARROW_DEFAULT
          The Default Movement arrow
static java.lang.String ARROW_UNICODE
          A fancier Unicode Movement arrow
static java.lang.String[] ARROWS
          A list of all Movement arrows
static char COAST_SEP_HYPEN
          Coast Separator: hyphen
static char COAST_SEP_NONE
          Coast Separator: none (a space; used for parenthetical coasts)
static char COAST_SEP_SLASH
          Coast Separator: forward slash
static int FORMAT_BRIEF
          Brief (abbreviated) format
static int FORMAT_COAST_PAREN_BRIEF
          For coasts only: abbreviated, in parentheses
static int FORMAT_COAST_PAREN_FULL
          For coasts only: non-abbreviated, in parentheses
static int FORMAT_FULL
          Full (non-abbreviated) format
static int STYLE_LOWER
          Lower case
static int STYLE_NONE
          Default style (no modification)
static int STYLE_PLURAL_LOWER
          Plural (adds an 's') Lower case
static int STYLE_PLURAL_NONE
          Plural (adds an 's') Default style (no modification)
static int STYLE_PLURAL_TITLE
          Plural (adds an 's') Title case (first word only)
static int STYLE_PLURAL_TITLE_ALL
          Plural (adds an 's') Title case (all words)
static int STYLE_PLURAL_UPPER
          Plural (adds an 's') Upper case
static int STYLE_TITLE
          Title case (first word only)
static int STYLE_TITLE_ALL
          Title case (all words)
static int STYLE_UPPER
          Upper case
 
Constructor Summary
OrderFormatOptions()
          Create an OrderFormatOptions object.
 
Method Summary
 java.lang.Object clone()
          Clone
static OrderFormatOptions createDebug()
          Create an OrderFormatOptions object with the debug settings.
static OrderFormatOptions createDefault()
          Create an OrderFormatOptions object with the default settings.
static OrderFormatOptions createNJudge()
          Create an OrderFormatOptions object with the NJudge settings.
static OrderFormatOptions createTerse()
          Create an OrderFormatOptions object with the terse settings.
static OrderFormatOptions createVerbose()
          Create an OrderFormatOptions object with the verbose settings.
static OrderFormatOptions decode(byte[] in, OrderFormatOptions defaultOptions)
          Decode an encoded String into the appropriate OrderFormatOptions
 byte[] encode()
          Encode this object as a compact String
 java.lang.String getArrow()
          Get the Movement Arrow
 int getCoastFormat()
          Gets the Coast Format
 char getCoastSeparator()
          Returns the Coast Separator, or returns COAST_SEP_NONE (a space), if coasts are to be formatted in parentheses.
 int getCoastStyle()
          Gets the Coast Style
 boolean getEndWithDot()
          Indicates if orders should end with a period
 int getOrderNameFormat()
          Gets the Order Name Format
 int getOrderNameStyle()
          Gets the Order Name Style
 int getPowerFormat()
          Gets the Power Format
 int getPowerStyle()
          Gets the Power Style
 int getProvinceFormat()
          Gets the Province Format
 int getProvinceStyle()
          Gets the Province Style
 boolean getShowPossessivePower()
          Indicates if Posessive Powers should be shown
 int getUnitFormat()
          Gets the Unit Format
 int getUnitStyle()
          Gets the Unit Style
 boolean isDebug()
          Indicates if debug mode is enabled
 void setArrow(java.lang.String value)
          Sets the Movement Arrow
 void setCoastFormat(int fmt)
          Sets the Coast Format
 void setCoastSeparator(char value)
          Set the character that separates the Province from the Coast
 void setCoastStyle(int style)
          Sets the Coast Style
 void setDebug(boolean value)
          When true, the Coast of a Location is always printed (even if, for example, it is a "/mv" coast).
 void setEndWithDot(boolean value)
          Sets if order should end with a period.
 void setOrderNameFormat(int fmt)
          Sets the Order Name Format
 void setOrderNameStyle(int style)
          Sets the Order Name Style
 void setPowerFormat(int fmt)
          Sets the Power Format
 void setPowerStyle(int style)
          Sets the Power Style
 void setProvinceFormat(int fmt)
          Sets the Province Format
 void setProvinceStyle(int style)
          Sets the Province Style
 void setShowPossessivePower(boolean value)
          Sets if Possessive Powers are displayed
 void setUnitFormat(int fmt)
          Sets the Unit Format
 void setUnitStyle(int style)
          Sets the Unit Style
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_NONE

public static final int STYLE_NONE
Default style (no modification)

See Also:
Constant Field Values

STYLE_LOWER

public static final int STYLE_LOWER
Lower case

See Also:
Constant Field Values

STYLE_UPPER

public static final int STYLE_UPPER
Upper case

See Also:
Constant Field Values

STYLE_TITLE

public static final int STYLE_TITLE
Title case (first word only)

See Also:
Constant Field Values

STYLE_TITLE_ALL

public static final int STYLE_TITLE_ALL
Title case (all words)

See Also:
Constant Field Values

STYLE_PLURAL_NONE

public static final int STYLE_PLURAL_NONE
Plural (adds an 's') Default style (no modification)

See Also:
Constant Field Values

STYLE_PLURAL_LOWER

public static final int STYLE_PLURAL_LOWER
Plural (adds an 's') Lower case

See Also:
Constant Field Values

STYLE_PLURAL_UPPER

public static final int STYLE_PLURAL_UPPER
Plural (adds an 's') Upper case

See Also:
Constant Field Values

STYLE_PLURAL_TITLE

public static final int STYLE_PLURAL_TITLE
Plural (adds an 's') Title case (first word only)

See Also:
Constant Field Values

STYLE_PLURAL_TITLE_ALL

public static final int STYLE_PLURAL_TITLE_ALL
Plural (adds an 's') Title case (all words)

See Also:
Constant Field Values

FORMAT_BRIEF

public static final int FORMAT_BRIEF
Brief (abbreviated) format

See Also:
Constant Field Values

FORMAT_FULL

public static final int FORMAT_FULL
Full (non-abbreviated) format

See Also:
Constant Field Values

FORMAT_COAST_PAREN_BRIEF

public static final int FORMAT_COAST_PAREN_BRIEF
For coasts only: abbreviated, in parentheses

See Also:
Constant Field Values

FORMAT_COAST_PAREN_FULL

public static final int FORMAT_COAST_PAREN_FULL
For coasts only: non-abbreviated, in parentheses

See Also:
Constant Field Values

ARROW_DEFAULT

public static final java.lang.String ARROW_DEFAULT
The Default Movement arrow

See Also:
Constant Field Values

ARROW_UNICODE

public static final java.lang.String ARROW_UNICODE
A fancier Unicode Movement arrow

See Also:
Constant Field Values

ARROWS

public static final java.lang.String[] ARROWS
A list of all Movement arrows


COAST_SEP_SLASH

public static final char COAST_SEP_SLASH
Coast Separator: forward slash

See Also:
Constant Field Values

COAST_SEP_HYPEN

public static final char COAST_SEP_HYPEN
Coast Separator: hyphen

See Also:
Constant Field Values

COAST_SEP_NONE

public static final char COAST_SEP_NONE
Coast Separator: none (a space; used for parenthetical coasts)

See Also:
Constant Field Values
Constructor Detail

OrderFormatOptions

public OrderFormatOptions()
Create an OrderFormatOptions object.

Method Detail

createDefault

public static OrderFormatOptions createDefault()
Create an OrderFormatOptions object with the default settings.


createTerse

public static OrderFormatOptions createTerse()
Create an OrderFormatOptions object with the terse settings.


createVerbose

public static OrderFormatOptions createVerbose()
Create an OrderFormatOptions object with the verbose settings.


createNJudge

public static OrderFormatOptions createNJudge()
Create an OrderFormatOptions object with the NJudge settings.


createDebug

public static OrderFormatOptions createDebug()
Create an OrderFormatOptions object with the debug settings. This is the createDefault() with setDebug() set to true..


getProvinceStyle

public int getProvinceStyle()
Gets the Province Style


getCoastStyle

public int getCoastStyle()
Gets the Coast Style


getPowerStyle

public int getPowerStyle()
Gets the Power Style


getUnitStyle

public int getUnitStyle()
Gets the Unit Style


getOrderNameStyle

public int getOrderNameStyle()
Gets the Order Name Style


getProvinceFormat

public int getProvinceFormat()
Gets the Province Format


getCoastFormat

public int getCoastFormat()
Gets the Coast Format


getPowerFormat

public int getPowerFormat()
Gets the Power Format


getUnitFormat

public int getUnitFormat()
Gets the Unit Format


getOrderNameFormat

public int getOrderNameFormat()
Gets the Order Name Format


getArrow

public java.lang.String getArrow()
Get the Movement Arrow


getShowPossessivePower

public boolean getShowPossessivePower()
Indicates if Posessive Powers should be shown


getEndWithDot

public boolean getEndWithDot()
Indicates if orders should end with a period


isDebug

public boolean isDebug()
Indicates if debug mode is enabled


getCoastSeparator

public char getCoastSeparator()
Returns the Coast Separator, or returns COAST_SEP_NONE (a space), if coasts are to be formatted in parentheses. (e.g., FORMAT_COAST_PAREN_BRIEF).


setProvinceStyle

public void setProvinceStyle(int style)
Sets the Province Style


setCoastStyle

public void setCoastStyle(int style)
Sets the Coast Style


setPowerStyle

public void setPowerStyle(int style)
Sets the Power Style


setUnitStyle

public void setUnitStyle(int style)
Sets the Unit Style


setOrderNameStyle

public void setOrderNameStyle(int style)
Sets the Order Name Style


setProvinceFormat

public void setProvinceFormat(int fmt)
Sets the Province Format


setCoastFormat

public void setCoastFormat(int fmt)
Sets the Coast Format


setPowerFormat

public void setPowerFormat(int fmt)
Sets the Power Format


setUnitFormat

public void setUnitFormat(int fmt)
Sets the Unit Format


setOrderNameFormat

public void setOrderNameFormat(int fmt)
Sets the Order Name Format


setArrow

public void setArrow(java.lang.String value)
Sets the Movement Arrow


setShowPossessivePower

public void setShowPossessivePower(boolean value)
Sets if Possessive Powers are displayed


setEndWithDot

public void setEndWithDot(boolean value)
Sets if order should end with a period.


setDebug

public void setDebug(boolean value)
When true, the Coast of a Location is always printed (even if, for example, it is a "/mv" coast). Furthermore, if a variable is null, it will be output as null and followed by its type (in brackets); e.g.: "null[Location]", instead of being ignored.


setCoastSeparator

public void setCoastSeparator(char value)
Set the character that separates the Province from the Coast


encode

public byte[] encode()
Encode this object as a compact String


decode

public static OrderFormatOptions decode(byte[] in,
                                        OrderFormatOptions defaultOptions)
Decode an encoded String into the appropriate OrderFormatOptions


clone

public java.lang.Object clone()
Clone



Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.