ocean.negotiation
Class AgentFactoryImpl

java.lang.Object
  |
  +--ocean.negotiation.AgentFactoryImpl
All Implemented Interfaces:
AgentFactory

public class AgentFactoryImpl
extends java.lang.Object
implements AgentFactory

The default implementation of the AgentFactory interface. This class creates Agent implementations depending on trade proposal document content.


Constructor Summary
AgentFactoryImpl()
           
 
Method Summary
 Agent CreateAgent(OCEANDoc doc)
          Create an Agent based on content in the trade proposal document.
 Agent CreateAgent(java.lang.String docContent)
          Create an Agent based on content in the trade proposal document.
protected static boolean IsBuyer(org.w3c.dom.Document DOMDoc)
          Check whether the Document is a buyer document.
protected static boolean IsSeller(org.w3c.dom.Document DOMDoc)
          Check whether the Document is a seller document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentFactoryImpl

public AgentFactoryImpl()
Method Detail

CreateAgent

public Agent CreateAgent(OCEANDoc doc)
Create an Agent based on content in the trade proposal document.
Specified by:
CreateAgent in interface AgentFactory
Parameters:
doc - the trade proposal document
Returns:
BuyersAgent if given a buyer document; SellersAgent if given a seller document.

CreateAgent

public Agent CreateAgent(java.lang.String docContent)
Create an Agent based on content in the trade proposal document.
Specified by:
CreateAgent in interface AgentFactory
Parameters:
docContent - document content.
Returns:
BuyersAgent if given a buyer document; SellersAgent if given a seller document.

IsBuyer

protected static boolean IsBuyer(org.w3c.dom.Document DOMDoc)
Check whether the Document is a buyer document.
Parameters:
DOMDoc - document to check
Returns:
true if a buyer document, false otherwise

IsSeller

protected static boolean IsSeller(org.w3c.dom.Document DOMDoc)
Check whether the Document is a seller document.
Parameters:
DOMDoc - document to check
Returns:
true if a seller document, false otherwise