|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umich.eecs.tac.props.AbstractTransportable
edu.umich.eecs.tac.props.Ad
public class Ad
This class represents an advertisement in the TAC/AA scenario. Advertisements
can be generic or targeted depending on whether the ad specifies a product.
Advertisers will primarily use this class with BidBundle in specifying
which advertisements to display for individual queries.
| Constructor Summary | |
|---|---|
Ad()
Creates a generic ad. |
|
Ad(Product product)
Creates a targeted ad if product is not null. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Returns true if the object is an Ad and has the same product or lack thereof. |
Product |
getProduct()
Returns the product the ad is targeting. |
int |
hashCode()
Returns a hash code based on the contained product. |
boolean |
isGeneric()
Returns true if the ad is generic and false if the ad is targeted. |
protected void |
readWithLock(se.sics.isl.transport.TransportReader reader)
Reads the product from the reader. |
void |
setProduct(Product product)
Sets the product for the ad. |
java.lang.String |
toString()
Creates a string that displays whether the ad is generic and the product, if targeted. |
protected void |
writeWithLock(se.sics.isl.transport.TransportWriter writer)
Writes the product to the writer. |
| Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportable |
|---|
getTransportName, isLocked, lock, lockCheck, read, write |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Ad()
public Ad(Product product)
product is not null. The ad is generic if the product is null.
product - the targeting product. The ad is generic if the product is null.| Method Detail |
|---|
public final boolean isGeneric()
true if the ad is generic and false if the ad is targeted.
true if the ad is generic and false if the ad is targeted.public final Product getProduct()
null if the ad is generic.
null if the ad is generic.
public final void setProduct(Product product)
throws java.lang.IllegalStateException
null sets the ad as generic.
product - the product for the ad. Setting the product to null sets the ad as generic.
java.lang.IllegalStateException - if the ad is locked.
protected final void readWithLock(se.sics.isl.transport.TransportReader reader)
throws java.text.ParseException
readWithLock in class AbstractTransportablereader - the reader to read data from.
java.text.ParseException - if there was an exception reading the product.protected final void writeWithLock(se.sics.isl.transport.TransportWriter writer)
writeWithLock in class AbstractTransportablewriter - the writer to write data to.public final java.lang.String toString()
toString in class java.lang.Objectpublic final boolean equals(java.lang.Object o)
true if the object is an Ad and has the same product or lack thereof.
equals in class java.lang.Objecto - the object to compare.
true if the object is an Ad and has the same product or lack thereof.public final int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||