Main Page | Packages | Class Hierarchy | Class List | File List | Class Members

saxparse.AimOrderMessage Class Reference

Inheritance diagram for saxparse.AimOrderMessage:

Inheritance graph
[legend]
Collaboration diagram for saxparse.AimOrderMessage:

Collaboration graph
[legend]
List of all members.

Detailed Description

AimOrderMessage Aug 11, 2004.

Process the XML elements (and character fields) associated with the AimOrder object. An aim order defines a market trading objective. For example, purchase 1000 shares of a stock. The aim order trading strategy (instructions) may indicate whether the order will be submitted immediately to the market or traded over time.

Author:
Ian Kaplan, www.bearcave.com, iank@bearcave.com


Public Member Functions

MessageBase getMessage ()
void element (String localName, Attributes attributes)
void characters (String str)
void endElement (String localName)

Private Attributes

MessageStates mCurrentState = States.BAD_STATE
AimOrder mAimOrder = new AimOrder()


Member Function Documentation

void saxparse.AimOrderMessage.characters String  str  ) 
 

Implements saxparse.MessageInterface.

00081 { 00082 if (mCurrentState == States.MSG_BASE) { 00083 super.processCharacters( str, mAimOrder ); 00084 } 00085 else if (mCurrentState == States.SYMBOL) { 00086 mAimOrder.setSymbol( str ); 00087 } 00088 else if (mCurrentState == States.AMOUNT) { 00089 try { 00090 int i = Integer.parseInt( str ); 00091 mAimOrder.setAmount( i ); 00092 } 00093 catch ( NumberFormatException e) { 00094 System.out.println("AimOrderMessage: error in AMOUNT field value"); 00095 } 00096 } 00097 else if (mCurrentState == States.TARGET_PRICE) { 00098 try { 00099 float f = Float.parseFloat( str ); 00100 mAimOrder.setTargetPrice( f ); 00101 } 00102 catch (NumberFormatException e) { 00103 System.out.println("AimOrderMessage: error in TARGET_PRICE field value"); 00104 } 00105 } 00106 else if (mCurrentState == States.MARKET) { 00107 mAimOrder.setMarket( str ); 00108 } 00109 else if (mCurrentState == States.INSTRUCTIONS) { 00110 mAimOrder.setInstructions( str ); 00111 } 00112 } // characters

void saxparse.AimOrderMessage.element String  localName,
Attributes  attributes
 

Implements saxparse.MessageInterface.

00052 { 00053 mCurrentState = super.processElement(localName, attributes); 00054 if (mCurrentState == States.BAD_STATE) { 00055 System.out.println("AimOrderMessage: mCurrentState == " + 00056 mCurrentState ); 00057 } 00058 else if (mCurrentState != States.MSG_BASE) { 00059 if (localName.equals("symbol")) { 00060 mCurrentState = States.SYMBOL; 00061 } 00062 else if (localName.equals("amount")) { 00063 mCurrentState = States.AMOUNT; 00064 } 00065 else if (localName.equals("targetPrice")) { 00066 mCurrentState = States.TARGET_PRICE; 00067 } 00068 else if (localName.equals("market")) { 00069 mCurrentState = States.MARKET; 00070 } 00071 else if (localName.equals("processingInstructions")) { 00072 mCurrentState = States.INSTRUCTIONS; 00073 } 00074 else { 00075 System.out.println("AimOrderMessage: unrecognized element = " + localName ); 00076 } 00077 } 00078 } // element

void saxparse.AimOrderMessage.endElement String  localName  ) 
 

Implements saxparse.MessageInterface.

00116 { 00117 if (mCurrentState == States.MSG_BASE) { 00118 super.processEndElement( localName ); 00119 } 00120 }

MessageBase saxparse.AimOrderMessage.getMessage  ) 
 

Implements saxparse.MessageInterface.

00049 { return mAimOrder; }


Member Data Documentation

AimOrder saxparse.AimOrderMessage.mAimOrder = new AimOrder() [private]
 

MessageStates saxparse.AimOrderMessage.mCurrentState = States.BAD_STATE [private]
 


The documentation for this class was generated from the following file:
Generated on Sat Aug 28 13:50:03 2004 for SaxParse by doxygen 1.3.8