edu.cuny.cat.market.accepting
Class CombiAcceptingPolicy

java.lang.Object
  extended by edu.cuny.cat.market.AuctioneerPolicy
      extended by edu.cuny.cat.market.accepting.ShoutAcceptingPolicy
          extended by edu.cuny.cat.market.accepting.CombiAcceptingPolicy
All Implemented Interfaces:
AuctionEventListener, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable
Direct Known Subclasses:
LooserCombiAcceptingPolicy, TighterCombiAcceptingPolicy

public abstract class CombiAcceptingPolicy
extends ShoutAcceptingPolicy

An accepting policy that combines several different accepting policies.

Parameters

base.n
int >= 1
(the number of different accepting policies to configure)
base.n
name of class, inheriting ShoutAcceptingPolicy
(the nth accepting policy)

Default Base

combi_accepting

Version:
$Revision: 1.8 $
Author:
Jinzhong Niu

Field Summary
static java.lang.String P_DEF_BASE
           
static java.lang.String P_NUM
           
protected  java.util.List<ShoutAcceptingPolicy> policies
           
 
Fields inherited from class edu.cuny.cat.market.AuctioneerPolicy
auctioneer
 
Constructor Summary
CombiAcceptingPolicy()
           
CombiAcceptingPolicy(java.util.List<ShoutAcceptingPolicy> policies)
           
 
Method Summary
 void addPolicy(ShoutAcceptingPolicy policy)
          Add a new policy
 void eventOccurred(AuctionEvent event)
           
<P extends ShoutAcceptingPolicy>
P
getPolicy(java.lang.Class<P> policyClass)
           
 java.util.Iterator<ShoutAcceptingPolicy> policyIterator()
           
 void reset()
          resets the state to be the same as the policy is created and initialized.
 void setAuctioneer(Auctioneer auctioneer)
           
 void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.cuny.cat.market.accepting.ShoutAcceptingPolicy
check
 
Methods inherited from class edu.cuny.cat.market.AuctioneerPolicy
getAuctioneer, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_DEF_BASE

public static final java.lang.String P_DEF_BASE
See Also:
Constant Field Values

P_NUM

public static final java.lang.String P_NUM
See Also:
Constant Field Values

policies

protected java.util.List<ShoutAcceptingPolicy> policies
Constructor Detail

CombiAcceptingPolicy

public CombiAcceptingPolicy(java.util.List<ShoutAcceptingPolicy> policies)

CombiAcceptingPolicy

public CombiAcceptingPolicy()
Method Detail

setup

public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
Specified by:
setup in interface edu.cuny.config.param.Parameterizable
Overrides:
setup in class AuctioneerPolicy

reset

public void reset()
Description copied from class: AuctioneerPolicy
resets the state to be the same as the policy is created and initialized.

Specified by:
reset in interface edu.cuny.obj.Resetable
Overrides:
reset in class AuctioneerPolicy

addPolicy

public void addPolicy(ShoutAcceptingPolicy policy)
Add a new policy


policyIterator

public java.util.Iterator<ShoutAcceptingPolicy> policyIterator()

getPolicy

public <P extends ShoutAcceptingPolicy> P getPolicy(java.lang.Class<P> policyClass)

eventOccurred

public void eventOccurred(AuctionEvent event)
Specified by:
eventOccurred in interface AuctionEventListener
Overrides:
eventOccurred in class AuctioneerPolicy

setAuctioneer

public void setAuctioneer(Auctioneer auctioneer)
Overrides:
setAuctioneer in class AuctioneerPolicy

toString

public java.lang.String toString()
Overrides:
toString in class AuctioneerPolicy