dip.order.result
Class Result

java.lang.Object
  extended bydip.order.result.Result
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
OrderResult, TimeResult

public class Result
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

A Result is a message that is sent from the adjudicator back to a power or all powers concerning turn processing.

Result and subclasses have a toString() method, which is intended for debugging. To obtain a properly-formatted localized message, use getMessage().

See Also:
Serialized Form

Field Summary
protected  java.lang.String message
          The Message text; this must never be null
protected  Power power
          The Power to whom this Result applies; null if it applies to everyone
 
Constructor Summary
protected Result()
          no-arg constructor for subclasses
  Result(Power power, java.lang.String message)
          Create a Result, that is for the given Power.
  Result(java.lang.String message)
          Create a Result that is applicable to all Powers.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare first by Power, then by Message.
 java.lang.String getMessage()
          Get the message.
 java.lang.String getMessage(OrderFormatOptions ofo)
          Get the message.
 Power getPower()
          Get the Power (or null if none) for whom this result is intended.
 java.lang.String toString()
          For debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

power

protected Power power
The Power to whom this Result applies; null if it applies to everyone


message

protected java.lang.String message
The Message text; this must never be null

Constructor Detail

Result

protected Result()
no-arg constructor for subclasses


Result

public Result(Power power,
              java.lang.String message)
Create a Result, that is for the given Power. A null Power indicates the result applies to all Powers.


Result

public Result(java.lang.String message)
Create a Result that is applicable to all Powers.

Method Detail

getPower

public Power getPower()
Get the Power (or null if none) for whom this result is intended.


getMessage

public final java.lang.String getMessage()
Get the message. Never returns null. This is equivalent to calling getMessage(OrderFormatOptions.DEFAULT).

This method is marked final so that subclasses more properly override the getMessage(OrderFormatOptions) method.


getMessage

public java.lang.String getMessage(OrderFormatOptions ofo)
Get the message. Never returns null.

Uses the given order format options (if applicable) for formatting Province and Order names. Subclasses must override this method to implement this.


toString

public java.lang.String toString()
For debugging. Use getPower() and getMessage() for general use.


compareTo

public int compareTo(java.lang.Object o)
Compare first by Power, then by Message.

If power is null, it will be first in ascending order. If message may be empty, but never is null.

Specified by:
compareTo in interface java.lang.Comparable


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