edu.umich.eecs.tac.props
Class Pricing

java.lang.Object
  extended by edu.umich.eecs.tac.props.AbstractTransportable
      extended by edu.umich.eecs.tac.props.Pricing
All Implemented Interfaces:
java.io.Serializable, se.sics.isl.transport.Transportable

public class Pricing
extends AbstractTransportable

Pricing represents the CPC's charged to the advertisers when a user clicks.

Author:
Patrick Jordan
See Also:
TAC Documentation, Serialized Form

Constructor Summary
Pricing()
          Creates an empty pricing.
 
Method Summary
 java.util.Set<AdLink> adLinks()
          Returns the set of ad links priced.
 double getPrice(AdLink ad)
          Returns the CPC of the AdLink.
protected  void readPriceEntry(se.sics.isl.transport.TransportReader reader)
          Reads the price entry from the writer.
protected  void readWithLock(se.sics.isl.transport.TransportReader reader)
          Reads the pricing information from the reader.
 void setPrice(AdLink ad, double price)
          Sets the price of the AdLink.
protected  void writePriceEntry(se.sics.isl.transport.TransportWriter writer, java.lang.Double price, AdLink adLink)
          Writes the price entry to the writer.
protected  void writeWithLock(se.sics.isl.transport.TransportWriter writer)
          Writes the pricing information to the reader.
 
Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportable
getTransportName, isLocked, lock, lockCheck, read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pricing

public Pricing()
Creates an empty pricing.

Method Detail

setPrice

public final void setPrice(AdLink ad,
                           double price)
                    throws java.lang.NullPointerException
Sets the price of the AdLink.

Parameters:
ad - the ad link.
price - the CPC.
Throws:
java.lang.NullPointerException - if the ad link is null.

getPrice

public final double getPrice(AdLink ad)
Returns the CPC of the AdLink.

Parameters:
ad - the ad link.
Returns:
the CPC of the AdLink.

adLinks

public final java.util.Set<AdLink> adLinks()
Returns the set of ad links priced.

Returns:
the set of ad links priced.

readWithLock

protected final void readWithLock(se.sics.isl.transport.TransportReader reader)
                           throws java.text.ParseException
Reads the pricing information from the reader.

Specified by:
readWithLock in class AbstractTransportable
Parameters:
reader - the reader to read data from.
Throws:
java.text.ParseException - if exception occurs when reading the mapping.

writeWithLock

protected final void writeWithLock(se.sics.isl.transport.TransportWriter writer)
Writes the pricing information to the reader.

Specified by:
writeWithLock in class AbstractTransportable
Parameters:
writer - the writer to write data to.

writePriceEntry

protected final void writePriceEntry(se.sics.isl.transport.TransportWriter writer,
                                     java.lang.Double price,
                                     AdLink adLink)
Writes the price entry to the writer.

Parameters:
writer - the writer to write data to.
price - the CPC
adLink - the ad link

readPriceEntry

protected final void readPriceEntry(se.sics.isl.transport.TransportReader reader)
                             throws java.text.ParseException
Reads the price entry from the writer.

Parameters:
reader - the reader to read data from.
Throws:
java.text.ParseException - if exception occurs when a price entry


Copyright © 2007-2009 Association for Trading Agent Research. All Rights Reserved.