edu.umich.eecs.tac.props
Class BidBundle

java.lang.Object
  extended by edu.umich.eecs.tac.props.AbstractTransportable
      extended by edu.umich.eecs.tac.props.AbstractTransportableEntryListBacking<S>
          extended by edu.umich.eecs.tac.props.AbstractKeyedEntryList<Query,T>
              extended by edu.umich.eecs.tac.props.AbstractQueryKeyedReportTransportable<BidBundle.BidEntry>
                  extended by edu.umich.eecs.tac.props.BidBundle
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Query>, se.sics.isl.transport.Transportable

public class BidBundle
extends AbstractQueryKeyedReportTransportable<BidBundle.BidEntry>

BidBundles specify all relevant bidding information for a given Advertister. Each BidBundle contains a set of Bid Entries, each for a given query. Each BidEntry contains:

Each BidBundle also can contains a Campaign Daily Spend Limit, which specifies the total amount of money an advertiser is willing to spend over all queries daily.

Advertisers typically send BidBundles on a daily basis to the Publisher.

Author:
Ben Cassell, Patrick Jordan, Lee Callender
See Also:
Serialized Form

Nested Class Summary
static class BidBundle.BidEntry
          Each BidEntry contains: Ad - The ad to be used for the given query. Bid - The given bid to be used for the given query. Daily Limit - The daily spend limit to be used for the given query
 
Field Summary
static double NO_SHOW_BID
          Advertiser's wishing not to be shown should use the given NO_SHOW_BID value.
static double NO_SPEND_LIMIT
          Advertiser's wishing to have no spend limit should use the given NO_SPEND_LIMIT value.
static Ad PERSISTENT_AD
          The persistent value for ad.
static double PERSISTENT_BID
          The persistent value for bid.
static double PERSISTENT_SPEND_LIMIT
          The persistent value for spend limit.
 
Constructor Summary
BidBundle()
          Creates a new BidBundle.
 
Method Summary
 void addQuery(Query query, double bid, Ad ad)
          Adds a BidBundle.BidEntry keyed with the specified query and the given bid and Ad.
 void addQuery(Query query, double bid, Ad ad, double dailyLimit)
          Adds a BidBundle.BidEntry keyed with the specified query and the given bid and Ad.
protected  BidBundle.BidEntry createEntry(Query key)
          Creates a BidBundle.BidEntry with the given query as the key.
protected  java.lang.Class entryClass()
          Returns the BidBundle.BidEntry class.
 Ad getAd(int index)
          Returns the ad for the associated query.
 Ad getAd(Query query)
          Returns the ad for the associated query.
 double getBid(int index)
          Returns the bid for the associated query.
 double getBid(Query query)
          Returns the bid for the associated query.
 double getCampaignDailySpendLimit()
          Returns the campaign daily spend limit for the associated query.
 double getDailyLimit(int index)
          Returns the daily spend limit for the associated query.
 double getDailyLimit(Query query)
          Returns the daily spend limit for the associated query.
protected  void readBeforeEntries(se.sics.isl.transport.TransportReader reader)
          Reads the campaign daily spend limit from the reader.
 void setAd(int index, Ad ad)
          Sets the ad for a query.
 void setAd(Query query, Ad ad)
          Sets the ad for a query.
 void setBid(int index, double bid)
          Sets the bid for a query.
 void setBid(Query query, double bid)
          Sets the bid for a query.
 void setBidAndAd(int index, double bid, Ad ad)
          Sets the bid and ad for a query.
 void setBidAndAd(Query query, double bid, Ad ad)
          Sets the bid and ad for a query.
 void setCampaignDailySpendLimit(double campaignDailySpendLimit)
          Sets the campaign daily spend limit.
 void setDailyLimit(int index, double dailyLimit)
          Sets the daily spend limit for a query.
 void setDailyLimit(Query query, double dailyLimit)
          Sets the daily spend limit for a query.
protected  void toStringBeforeEntries(java.lang.StringBuilder builder)
          Appends the campaign daily spend limit.
protected  void writeBeforeEntries(se.sics.isl.transport.TransportWriter writer)
          Writes the campaign daily spend limit to the writer.
 
Methods inherited from class edu.umich.eecs.tac.props.AbstractQueryKeyedReportTransportable
addQuery, containsQuery, getQuery
 
Methods inherited from class edu.umich.eecs.tac.props.AbstractKeyedEntryList
addKey, containsKey, getEntry, getKey, indexForEntry, iterator, keys
 
Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportableEntryListBacking
addEntry, afterAddEntry, afterRemoveEntry, beforeAddEntry, beforeRemoveEntry, getEntries, getEntry, readAfterEntries, readWithLock, removeEntry, size, toString, toStringAfterEntries, writeAfterEntries, writeWithLock
 
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, wait, wait, wait
 

Field Detail

PERSISTENT_SPEND_LIMIT

public static final double PERSISTENT_SPEND_LIMIT
The persistent value for spend limit. Publisher's reading a persistent value will ignore the value and instead use yesterday's given spend limit in its place.

See Also:
Constant Field Values

PERSISTENT_BID

public static final double PERSISTENT_BID
The persistent value for bid. Publisher's reading a persistent value will ignore the value and instead use yesterday's given bid in its place.

See Also:
Constant Field Values

PERSISTENT_AD

public static final Ad PERSISTENT_AD
The persistent value for ad. Publisher's reading a persistent value will ignore the value and instead use yesterday's given Ad in its place.


NO_SPEND_LIMIT

public static final double NO_SPEND_LIMIT
Advertiser's wishing to have no spend limit should use the given NO_SPEND_LIMIT value.

See Also:
Constant Field Values

NO_SHOW_BID

public static final double NO_SHOW_BID
Advertiser's wishing not to be shown should use the given NO_SHOW_BID value.

See Also:
Constant Field Values
Constructor Detail

BidBundle

public BidBundle()
Creates a new BidBundle. Sets the campaign daily spend limit to the PERSISTENT_SPEND_LIMIT.

Method Detail

createEntry

protected final BidBundle.BidEntry createEntry(Query key)
Creates a BidBundle.BidEntry with the given query as the key.

Specified by:
createEntry in class AbstractKeyedEntryList<Query,BidBundle.BidEntry>
Parameters:
key - the query key
Returns:
a BidBundle.BidEntry with the given query as the key.

entryClass

protected final java.lang.Class entryClass()
Returns the BidBundle.BidEntry class.

Specified by:
entryClass in class AbstractTransportableEntryListBacking<BidBundle.BidEntry>
Returns:
the BidBundle.BidEntry class.

addQuery

public final void addQuery(Query query,
                           double bid,
                           Ad ad)
Adds a BidBundle.BidEntry keyed with the specified query and the given bid and Ad. The spend limit is set to PERSISTENT_SPEND_LIMIT.

Parameters:
query - the query key.
bid - the bid value.
ad - the ad to be used.

addQuery

public final void addQuery(Query query,
                           double bid,
                           Ad ad,
                           double dailyLimit)
Adds a BidBundle.BidEntry keyed with the specified query and the given bid and Ad. The spend limit is set to PERSISTENT_SPEND_LIMIT.

Parameters:
query - the query key.
bid - the bid value.
ad - the ad to be used.
dailyLimit - the daily limit.

setBid

public final void setBid(Query query,
                         double bid)
Sets the bid for a query.

Parameters:
query - the query.
bid - the bid.

setBid

public final void setBid(int index,
                         double bid)
Sets the bid for a query.

Parameters:
index - the index of the query.
bid - the bid.

setAd

public final void setAd(Query query,
                        Ad ad)
Sets the ad for a query.

Parameters:
query - the query.
ad - the ad.

setAd

public final void setAd(int index,
                        Ad ad)
Sets the ad for a query.

Parameters:
index - the index of the query.
ad - the ad.

setDailyLimit

public final void setDailyLimit(Query query,
                                double dailyLimit)
Sets the daily spend limit for a query.

Parameters:
query - the query.
dailyLimit - the daily spend limit.

setDailyLimit

public final void setDailyLimit(int index,
                                double dailyLimit)
Sets the daily spend limit for a query.

Parameters:
index - the index of the query.
dailyLimit - the daily spend limit.

setBidAndAd

public final void setBidAndAd(Query query,
                              double bid,
                              Ad ad)
Sets the bid and ad for a query.

Parameters:
query - the query.
bid - the bid.
ad - the ad.

setBidAndAd

public final void setBidAndAd(int index,
                              double bid,
                              Ad ad)
Sets the bid and ad for a query.

Parameters:
index - the index of the query.
bid - the bid.
ad - the ad.

getBid

public final double getBid(Query query)
Returns the bid for the associated query.

Parameters:
query - the query.
Returns:
the bid.

getBid

public final double getBid(int index)
Returns the bid for the associated query.

Parameters:
index - the index of the query.
Returns:
the bid.

getAd

public final Ad getAd(Query query)
Returns the ad for the associated query.

Parameters:
query - the query.
Returns:
the ad.

getAd

public final Ad getAd(int index)
Returns the ad for the associated query.

Parameters:
index - the index of the query.
Returns:
the ad.

getDailyLimit

public final double getDailyLimit(Query query)
Returns the daily spend limit for the associated query.

Parameters:
query - the query.
Returns:
the daily spend limit.

getDailyLimit

public final double getDailyLimit(int index)
Returns the daily spend limit for the associated query.

Parameters:
index - the index of the query.
Returns:
the daily spend limit.

getCampaignDailySpendLimit

public final double getCampaignDailySpendLimit()
Returns the campaign daily spend limit for the associated query.

Returns:
the campaign daily spend limit.

setCampaignDailySpendLimit

public final void setCampaignDailySpendLimit(double campaignDailySpendLimit)
Sets the campaign daily spend limit.

Parameters:
campaignDailySpendLimit - the campaign daily spend limit.

readBeforeEntries

protected final void readBeforeEntries(se.sics.isl.transport.TransportReader reader)
                                throws java.text.ParseException
Reads the campaign daily spend limit from the reader.

Overrides:
readBeforeEntries in class AbstractTransportableEntryListBacking<BidBundle.BidEntry>
Parameters:
reader - the reader that is read from.
Throws:
java.text.ParseException - if exception occurs before reading the campaign daily spend limit

writeBeforeEntries

protected final void writeBeforeEntries(se.sics.isl.transport.TransportWriter writer)
Writes the campaign daily spend limit to the writer.

Overrides:
writeBeforeEntries in class AbstractTransportableEntryListBacking<BidBundle.BidEntry>
Parameters:
writer - the writer that is written to.

toStringBeforeEntries

protected final void toStringBeforeEntries(java.lang.StringBuilder builder)
Appends the campaign daily spend limit.

Overrides:
toStringBeforeEntries in class AbstractTransportableEntryListBacking<BidBundle.BidEntry>
Parameters:
builder - the builder to append for the AbstractTransportableEntryListBacking.toString()


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