dip.order.result
Class OrderResult

java.lang.Object
  extended bydip.order.result.Result
      extended bydip.order.result.OrderResult
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
BouncedResult, ConvoyPathResult, DependentMoveFailedResult, DislodgedResult, SubstitutedResult

public class OrderResult
extends Result

A message sent to a specific Power that refers to a specific order. The message is classified according to ResultType (see for details).

More than one OrderResult may exist for a single order.

See Also:
Serialized Form

Nested Class Summary
static class OrderResult.ResultType
          Type-Safe enumerated categories of OrderResults.
 
Field Summary
protected  Orderable order
          The Order to which this Result refers
protected  OrderResult.ResultType resultType
          The ResultType
 
Fields inherited from class dip.order.result.Result
message, power
 
Constructor Summary
protected OrderResult()
          no-arg constructor for subclasses
  OrderResult(Orderable order, OrderResult.ResultType type, java.lang.String message)
          Create an OrderResult with the given Order, ResultType, and Message.
  OrderResult(Orderable order, java.lang.String message)
          Create an OrderResult with the given Order and Message.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare in the following order: Power (null first) Orderable source province [null first] ResultType [never null] message [never null, but may be empty] If power is null, it will be first in ascending order.
 Orderable getOrder()
          Get the Order.
 OrderResult.ResultType getResultType()
          Get the ResultType.
 java.lang.String toString()
          For debugging
 
Methods inherited from class dip.order.result.Result
getMessage, getMessage, getPower
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resultType

protected OrderResult.ResultType resultType
The ResultType


order

protected Orderable order
The Order to which this Result refers

Constructor Detail

OrderResult

protected OrderResult()
no-arg constructor for subclasses


OrderResult

public OrderResult(Orderable order,
                   java.lang.String message)
Create an OrderResult with the given Order and Message. A null order is not permissable.


OrderResult

public OrderResult(Orderable order,
                   OrderResult.ResultType type,
                   java.lang.String message)
Create an OrderResult with the given Order, ResultType, and Message. A null Order or ResultType is not permissable.

Method Detail

getResultType

public OrderResult.ResultType getResultType()
Get the ResultType. Never returns null.


getOrder

public Orderable getOrder()
Get the Order. Never return null.


toString

public java.lang.String toString()
For debugging

Overrides:
toString in class Result

compareTo

public int compareTo(java.lang.Object o)
Compare in the following order:
  1. Power (null first)
  2. Orderable source province [null first]
  3. ResultType [never null]
  4. message [never null, but may be empty]

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
Overrides:
compareTo in class Result


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