|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umich.eecs.tac.props.AbstractTransportable edu.umich.eecs.tac.props.AdLink
public class AdLink
This class represents an ad link. It contains an Ad
as well as a string for the advertiser's address.
Note that ad links are created by the publisher from ads specified in an advertisers bid bundle and thus are not
directly used by the advertiser.
Constructor Summary | |
---|---|
AdLink()
Creates a generic ad link. |
|
AdLink(Ad ad,
java.lang.String advertiser)
Creates an ad link from a given ad and advertiser. |
|
AdLink(Product product,
java.lang.String advertiser)
Creates an ad link with the supplied Product and advertiser. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Returns true if the object is an AdLink and has the same ad and advertiser. |
Ad |
getAd()
Returns the ad backing the ad link. |
java.lang.String |
getAdvertiser()
Returns the advertiser's address. |
int |
hashCode()
Returns a hash code based on the contained ad and advertiser. |
protected void |
readWithLock(se.sics.isl.transport.TransportReader reader)
Reads the advertiser's address and ad from the reader. |
void |
setAd(Ad ad)
Sets the ad backing the ad link. |
void |
setAdvertiser(java.lang.String advertiser)
Specify and advertiser's address for this ad link. |
java.lang.String |
toString()
Returns a string representation of the ad link. |
protected void |
writeWithLock(se.sics.isl.transport.TransportWriter writer)
Writes the advertiser's address and ad 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 AdLink()
null
and a null
ad.
public AdLink(Product product, java.lang.String advertiser)
Product
and advertiser. An Ad
with the given product is
created.
product
- the product.advertiser
- the advertiser address.public AdLink(Ad ad, java.lang.String advertiser)
ad
and advertiser.
ad
- the ad.advertiser
- the advertiser.Method Detail |
---|
public final java.lang.String getAdvertiser()
public final Ad getAd()
ad
backing the ad link.
public final void setAd(Ad ad)
ad
backing the ad link.
ad
- the ad.public final void setAdvertiser(java.lang.String advertiser) throws java.lang.IllegalStateException
advertiser
- the advertiser's address contained in the ad link.
java.lang.IllegalStateException
- if the ad link is locked.protected final void readWithLock(se.sics.isl.transport.TransportReader reader) throws java.text.ParseException
ad
from the reader.
readWithLock
in class AbstractTransportable
reader
- the reader to read data from.
java.text.ParseException
- if an exception occured reading the advertiser and ad
.protected final void writeWithLock(se.sics.isl.transport.TransportWriter writer)
ad
to the writer.
writeWithLock
in class AbstractTransportable
writer
- the writer to write data to.public final boolean equals(java.lang.Object o)
true
if the object is an AdLink
and has the same ad
and advertiser.
equals
in class java.lang.Object
o
- the object to compare.
true
if the object is an AdLink
and has the same ad
and advertiser.public final int hashCode()
ad
and advertiser.
hashCode
in class java.lang.Object
ad
and advertiser.public final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |