edu.umich.eecs.tac.props
Class QueryReport

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<QueryReport.QueryReportEntry>
                  extended by edu.umich.eecs.tac.props.QueryReport
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Query>, se.sics.isl.transport.Transportable

public class QueryReport
extends AbstractQueryKeyedReportTransportable<QueryReport.QueryReportEntry>

Query report contains impressions, clicks, cost, average position, and ad displayed by the advertiser for each query class during the period as well as the positions and displayed ads of all advertisers during the period for each query class.

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

Nested Class Summary
static class QueryReport.DisplayReport
          Display report contains the positions and displayed ads of all advertisers during the period for each query class.
static class QueryReport.DisplayReportEntry
          Display report entry contains the positions and displayed ads of the advertiser during the period.
static class QueryReport.QueryReportEntry
          Query report entry holds the impressions, clicks, cost, average position, and ad displayed by the advertiser for each query class during the period as well as the positions and displayed ads of all advertisers during the period.
 
Constructor Summary
QueryReport()
          Creates a new query report.
 
Method Summary
 void addClicks(int index, int clicks)
          Adds the clicks to the associated query.
 void addClicks(int index, int clicks, double cost)
          Adds the clicks to the associated query.
 void addClicks(Query query, int clicks)
          Adds the clicks to the associated query.
 void addClicks(Query query, int clicks, double cost)
          Adds the clicks to the associated query.
 void addCost(int index, double cost)
          Adds the cost to the associated query.
 void addCost(Query query, double cost)
          Adds the cost to the associated query.
 void addImpressions(int index, int regular, int promoted)
          Adds the impressions associated with the query.
 void addImpressions(int index, int regular, int promoted, Ad ad, double positionSum)
          Adds the impressions associated with the query.
 void addImpressions(Query query, int regular, int promoted)
          Adds the impressions associated with the query.
 void addImpressions(Query query, int regular, int promoted, Ad ad, double positionSum)
          Adds the impressions associated with the query.
 void addQuery(Query query, int regularImpressions, int promotedImpressions, int clicks, double cost, double positionSum)
          Adds a QueryReport.QueryReportEntry keyed with the specificed query and the associated viewing statistics.
 java.util.Set<java.lang.String> advertisers(int index)
          Returns the set of advertisers with data for the given query.
 java.util.Set<java.lang.String> advertisers(Query query)
          Returns the set of advertisers with data for the given query.
protected  QueryReport.QueryReportEntry createEntry(Query query)
          Creates a QueryReport.QueryReportEntry with the given query as the key.
protected  java.lang.Class entryClass()
          Returns the QueryReport.QueryReportEntry class.
 Ad getAd(int index)
          Returns the shown ad for the associated query.
 Ad getAd(int index, java.lang.String advertiser)
          Returns the shown ad for the associated query and advertiser.
 Ad getAd(Query query)
          Returns the shown ad for the associated query.
 Ad getAd(Query query, java.lang.String advertiser)
          Returns the shown ad for the associated query and advertiser.
 int getClicks(int index)
          Returns the total number of clicks for the associated query.
 int getClicks(Query query)
          Returns the total number of clicks for the associated query.
 double getCost(int index)
          Returns the total cost for the associated query.
 double getCost(Query query)
          Returns the total cost for the associated query.
 double getCPC(int index)
          Returns the average CPC for the associated query.
 double getCPC(Query query)
          Returns the average CPC for the associated query.
 int getImpressions(int index)
          Returns the total number of impressions for the associated query.
 int getImpressions(Query query)
          Returns the total number of impressions for the associated query.
 double getPosition(int index)
          Returns the average position for the associated query.
 double getPosition(int index, java.lang.String advertiser)
          Returns the average position for the associated query and advertiser.
 double getPosition(Query query)
          Returns the average position for the associated query.
 double getPosition(Query query, java.lang.String advertiser)
          Returns the average position for the associated query and advertiser.
 int getPromotedImpressions(int index)
          Returns the total number of promoted impressions for the associated query.
 int getPromotedImpressions(Query query)
          Returns the total number of promoted impressions for the associated query.
 int getRegularImpressions(int index)
          Returns the total number of regular impressions for the associated query.
 int getRegularImpressions(Query query)
          Returns the total number of regular impressions for the associated query.
 void setAd(int index, Ad ad)
          Sets the shown ad for the associated query.
 void setAd(int index, java.lang.String advertiser, Ad ad)
          Sets the shown ad for the associated query and advertiser.
 void setAd(Query query, Ad ad)
          Sets the shown ad for the associated query.
 void setAd(Query query, java.lang.String advertiser, Ad ad)
          Sets the shown ad for the associated query and advertiser.
 void setAdAndPosition(int index, java.lang.String advertiser, Ad ad, double position)
          Sets the shown ad and average position for the associated query and advertiser.
 void setAdAndPosition(Query query, java.lang.String advertiser, Ad ad, double position)
          Sets the shown ad and average position for the associated query and advertiser.
 void setClicks(int index, int clicks)
          Sets the clicks for associated query.
 void setClicks(int index, int clicks, double cost)
          Sets the clicks for associated query.
 void setClicks(Query query, int clicks)
          Sets the clicks for associated query.
 void setClicks(Query query, int clicks, double cost)
          Sets the clicks for associated query.
 void setCost(int index, double cost)
          Sets the cost associated with the query.
 void setCost(Query query, double cost)
          Sets the cost associated with the query.
 void setImpressions(int index, int regularImpressions, int promotedImpressions)
          Sets the impressions associated with the query.
 void setImpressions(int index, int regular, int promoted, Ad ad, double positionSum)
          Sets the impressions associated with the query.
 void setImpressions(Query query, int regularImpressions, int promotedImpressions)
          Sets the impressions associated with the query.
 void setImpressions(Query query, int regularImpressions, int promotedImpressions, Ad ad, double positionSum)
          Sets the impressions associated with the query.
 void setPosition(int index, java.lang.String advertiser, double position)
          Sets the average position for the associated query and advertiser.
 void setPosition(Query query, java.lang.String advertiser, double position)
          Sets the average position for the associated query and advertiser.
 void setPositionSum(int index, double positionSum)
          Sets the sum of the positions over all the impressions for a query.
 void setPositionSum(Query query, double positionSum)
          Sets the sum of the positions over all the impressions for a query.
 
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, readBeforeEntries, readWithLock, removeEntry, size, toString, toStringAfterEntries, toStringBeforeEntries, writeAfterEntries, writeBeforeEntries, 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
 

Constructor Detail

QueryReport

public QueryReport()
Creates a new query report.

Method Detail

createEntry

protected final QueryReport.QueryReportEntry createEntry(Query query)
Creates a QueryReport.QueryReportEntry with the given query as the key.

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

entryClass

protected final java.lang.Class entryClass()
Returns the QueryReport.QueryReportEntry class.

Specified by:
entryClass in class AbstractTransportableEntryListBacking<QueryReport.QueryReportEntry>
Returns:
the QueryReport.QueryReportEntry class.

addQuery

public final void addQuery(Query query,
                           int regularImpressions,
                           int promotedImpressions,
                           int clicks,
                           double cost,
                           double positionSum)
Adds a QueryReport.QueryReportEntry keyed with the specificed query and the associated viewing statistics.

Parameters:
query - the query key.
regularImpressions - the number of regular impressions.
promotedImpressions - the number of promoted impressions.
clicks - the number of clicks.
cost - the cost of the clicks.
positionSum - the sum of the positions over all impressions.

setPositionSum

public final void setPositionSum(Query query,
                                 double positionSum)
Sets the sum of the positions over all the impressions for a query.

Parameters:
query - the query
positionSum - the sum of the positions over all the impressions for a query.

setPositionSum

public final void setPositionSum(int index,
                                 double positionSum)
Sets the sum of the positions over all the impressions for a query.

Parameters:
index - the index of the query
positionSum - the sum of the positions over all the impressions for a query.

setCost

public final void setCost(Query query,
                          double cost)
Sets the cost associated with the query.

Parameters:
query - the query
cost - the cost associated with the query.

setCost

public final void setCost(int index,
                          double cost)
Sets the cost associated with the query.

Parameters:
index - the query index
cost - the cost associated with the query.

setImpressions

public final void setImpressions(Query query,
                                 int regularImpressions,
                                 int promotedImpressions)
Sets the impressions associated with the query.

Parameters:
query - the query
regularImpressions - the regular impressions
promotedImpressions - the promoted impressions

setImpressions

public final void setImpressions(Query query,
                                 int regularImpressions,
                                 int promotedImpressions,
                                 Ad ad,
                                 double positionSum)
Sets the impressions associated with the query.

Parameters:
query - the query
regularImpressions - the regular impressions
promotedImpressions - the promoted impressions
ad - the ad shown
positionSum - the sum of positions over all impressions

addImpressions

public final void addImpressions(Query query,
                                 int regular,
                                 int promoted)
Adds the impressions associated with the query.

Parameters:
query - the query
regular - the reqular impressions
promoted - the promoted impressions

addImpressions

public final void addImpressions(Query query,
                                 int regular,
                                 int promoted,
                                 Ad ad,
                                 double positionSum)
Adds the impressions associated with the query.

Parameters:
query - the query
regular - the reqular impressions
promoted - the promoted impressions
ad - the ad shown
positionSum - the sum of positions over all impressions

addImpressions

public final void addImpressions(int index,
                                 int regular,
                                 int promoted)
Adds the impressions associated with the query.

Parameters:
index - the query index
regular - the reqular impressions
promoted - the promoted impressions

addImpressions

public final void addImpressions(int index,
                                 int regular,
                                 int promoted,
                                 Ad ad,
                                 double positionSum)
Adds the impressions associated with the query.

Parameters:
index - the query index
regular - the reqular impressions
promoted - the promoted impressions
ad - the ad shown
positionSum - the sum of positions over all impressions

setImpressions

public final void setImpressions(int index,
                                 int regularImpressions,
                                 int promotedImpressions)
Sets the impressions associated with the query.

Parameters:
index - the query index
regularImpressions - the regular impressions
promotedImpressions - the promoted impressions

setImpressions

public final void setImpressions(int index,
                                 int regular,
                                 int promoted,
                                 Ad ad,
                                 double positionSum)
Sets the impressions associated with the query.

Parameters:
index - the query index
regular - the regular impressions
promoted - the promoted impressions
ad - the ad shown
positionSum - the sum of positions over all impressions

setClicks

public final void setClicks(Query query,
                            int clicks)
Sets the clicks for associated query.

Parameters:
query - the query
clicks - the clicks

setClicks

public final void setClicks(Query query,
                            int clicks,
                            double cost)
Sets the clicks for associated query.

Parameters:
query - the query
clicks - the clicks
cost - the cost

setClicks

public final void setClicks(int index,
                            int clicks)
Sets the clicks for associated query.

Parameters:
index - the query index
clicks - the clicks

setClicks

public final void setClicks(int index,
                            int clicks,
                            double cost)
Sets the clicks for associated query.

Parameters:
index - the query index
clicks - the clicks
cost - the cost

addClicks

public final void addClicks(Query query,
                            int clicks)
Adds the clicks to the associated query.

Parameters:
query - the query
clicks - the clicks

addClicks

public final void addClicks(Query query,
                            int clicks,
                            double cost)
Adds the clicks to the associated query.

Parameters:
query - the query
clicks - the clicks
cost - the cost

addClicks

public final void addClicks(int index,
                            int clicks)
Adds the clicks to the associated query.

Parameters:
index - the query index
clicks - the clicks

addClicks

public final void addClicks(int index,
                            int clicks,
                            double cost)
Adds the clicks to the associated query.

Parameters:
index - the query index
clicks - the clicks
cost - the cost

addCost

public final void addCost(Query query,
                          double cost)
Adds the cost to the associated query.

Parameters:
query - the query
cost - the cost

addCost

public final void addCost(int index,
                          double cost)
Adds the cost to the associated query.

Parameters:
index - the query index
cost - the cost

getPosition

public final double getPosition(Query query)
Returns the average position for the associated query.

Parameters:
query - the query
Returns:
the average position for the associated query.

getPosition

public final double getPosition(int index)
Returns the average position for the associated query.

Parameters:
index - the query index
Returns:
the average position for the associated query.

getCPC

public final double getCPC(Query query)
Returns the average CPC for the associated query.

Parameters:
query - the query
Returns:
the average CPC for the associated query.

getCPC

public final double getCPC(int index)
Returns the average CPC for the associated query.

Parameters:
index - the query index
Returns:
the average CPC for the associated query.

getImpressions

public final int getImpressions(Query query)
Returns the total number of impressions for the associated query.

Parameters:
query - the query
Returns:
the total number of impressions for the associated query.

getImpressions

public final int getImpressions(int index)
Returns the total number of impressions for the associated query.

Parameters:
index - the query index
Returns:
the total number of impressions for the associated query.

getRegularImpressions

public final int getRegularImpressions(Query query)
Returns the total number of regular impressions for the associated query.

Parameters:
query - the query
Returns:
the total number of regular impressions for the associated query.

getRegularImpressions

public final int getRegularImpressions(int index)
Returns the total number of regular impressions for the associated query.

Parameters:
index - the query index
Returns:
the total number of regular impressions for the associated query.

getPromotedImpressions

public final int getPromotedImpressions(Query query)
Returns the total number of promoted impressions for the associated query.

Parameters:
query - the query
Returns:
the total number of promoted impressions for the associated query.

getPromotedImpressions

public final int getPromotedImpressions(int index)
Returns the total number of promoted impressions for the associated query.

Parameters:
index - the query index
Returns:
the total number of promoted impressions for the associated query.

getClicks

public final int getClicks(Query query)
Returns the total number of clicks for the associated query.

Parameters:
query - the query
Returns:
the total number of clicks for the associated query.

getClicks

public final int getClicks(int index)
Returns the total number of clicks for the associated query.

Parameters:
index - the query index
Returns:
the total number of clicks for the associated query.

getCost

public final double getCost(Query query)
Returns the total cost for the associated query.

Parameters:
query - the query
Returns:
the total cost for the associated query.

getCost

public final double getCost(int index)
Returns the total cost for the associated query.

Parameters:
index - the query index
Returns:
the total cost for the associated query.

getPosition

public final double getPosition(Query query,
                                java.lang.String advertiser)
Returns the average position for the associated query and advertiser.

Parameters:
query - the query
advertiser - the advertiser
Returns:
the average position for the associated query and advertiser.

getPosition

public final double getPosition(int index,
                                java.lang.String advertiser)
Returns the average position for the associated query and advertiser.

Parameters:
index - the query index
advertiser - the advertiser
Returns:
the average position for the associated query and advertiser.

setPosition

public final void setPosition(Query query,
                              java.lang.String advertiser,
                              double position)
Sets the average position for the associated query and advertiser.

Parameters:
query - the query
advertiser - the advertiser
position - the average position for the associated query and advertiser.

setPosition

public final void setPosition(int index,
                              java.lang.String advertiser,
                              double position)
Sets the average position for the associated query and advertiser.

Parameters:
index - the query index
advertiser - the advertiser
position - the average position for the associated query and advertiser.

getAd

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

Parameters:
query - the query
Returns:
the shown ad for the associated query.

getAd

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

Parameters:
index - the query index
Returns:
the shown ad for the associated query.

setAd

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

Parameters:
query - the query
ad - the ad

setAd

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

Parameters:
index - the query index
ad - the ad

getAd

public final Ad getAd(Query query,
                      java.lang.String advertiser)
Returns the shown ad for the associated query and advertiser.

Parameters:
query - the query
advertiser - the advertiser
Returns:
the shown ad for the associated query and advertiser.

getAd

public final Ad getAd(int index,
                      java.lang.String advertiser)
Returns the shown ad for the associated query and advertiser.

Parameters:
index - the query index
advertiser - the advertiser
Returns:
the shown ad for the associated query and advertiser.

setAd

public final void setAd(Query query,
                        java.lang.String advertiser,
                        Ad ad)
Sets the shown ad for the associated query and advertiser.

Parameters:
query - the query
advertiser - the advertiser
ad - the shown ad for the associated query and advertiser.

setAd

public final void setAd(int index,
                        java.lang.String advertiser,
                        Ad ad)
Sets the shown ad for the associated query and advertiser.

Parameters:
index - the query index
advertiser - the advertiser
ad - the shown ad for the associated query and advertiser.

setAdAndPosition

public final void setAdAndPosition(Query query,
                                   java.lang.String advertiser,
                                   Ad ad,
                                   double position)
Sets the shown ad and average position for the associated query and advertiser.

Parameters:
query - the query
advertiser - the advertiser
ad - the shown ad for the associated query and advertiser.
position - the average position for the associated query and advertiser.

setAdAndPosition

public final void setAdAndPosition(int index,
                                   java.lang.String advertiser,
                                   Ad ad,
                                   double position)
Sets the shown ad and average position for the associated query and advertiser.

Parameters:
index - the query index
advertiser - the advertiser
ad - the shown ad for the associated query and advertiser.
position - the average position for the associated query and advertiser.

advertisers

public final java.util.Set<java.lang.String> advertisers(Query query)
Returns the set of advertisers with data for the given query.

Parameters:
query - the query
Returns:
the set of advertisers with data for the given query.

advertisers

public final java.util.Set<java.lang.String> advertisers(int index)
Returns the set of advertisers with data for the given query.

Parameters:
index - the query index
Returns:
the set of advertisers with data for the given query.


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