|
||||||||||
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.Ranking
public class Ranking
Ranking represents the slots allocated to the advertisers' ad links
in an auction.
Nested Class Summary | |
---|---|
static class |
Ranking.Slot
The slot for the ranking. |
Constructor Summary | |
---|---|
Ranking()
Create an empty ranking. |
Method Summary | |
---|---|
void |
add(AdLink adLink)
Adds the ad link to the alots and set its promoted status to false . |
void |
add(AdLink adLink,
boolean promoted)
Adds the ad link to the alots and set its promoted status. |
protected void |
add(Ranking.Slot slot)
Adds the slot to the slot list. |
AdLink |
get(int position)
Returns the ad link at the slot position. |
boolean |
isPromoted(int position)
Returns the promoted status of the ad link at the slot position. |
int |
positionForAd(AdLink adLink)
Returns the slot position for the ad link in question and -1 if the
ad link is not in the ranking. |
protected void |
readWithLock(se.sics.isl.transport.TransportReader reader)
Reads the slots from the reader. |
void |
set(int position,
AdLink adLink,
boolean promoted)
Set the ad link and promoted status for the slot. |
int |
size()
Returns the number of slots in the ranking. |
java.lang.String |
toString()
Returns a string representation of the ranking. |
protected void |
writeWithLock(se.sics.isl.transport.TransportWriter writer)
Writes the slots 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Ranking()
Method Detail |
---|
public final void add(AdLink adLink, boolean promoted) throws java.lang.IllegalStateException
ad link
to the alots and set its promoted status.
adLink
- the ad linkpromoted
- true
if the ad link is promoted.
java.lang.IllegalStateException
- if the ranking is locked.public final void add(AdLink adLink) throws java.lang.IllegalStateException
ad link
to the alots and set its promoted status to false
.
adLink
- the ad link.
java.lang.IllegalStateException
- if the ranking is locked.protected final void add(Ranking.Slot slot) throws java.lang.IllegalStateException
slot
- the slot to add.
java.lang.IllegalStateException
- if the ranking is locked.public final void set(int position, AdLink adLink, boolean promoted) throws java.lang.IllegalStateException
ad link
and promoted status for the slot.
position
- the slot position.adLink
- the ad link.promoted
- the promoted status.
java.lang.IllegalStateException
- if the ranking is locked.public final AdLink get(int position)
ad link
at the slot position.
position
- the slot position.
ad link
at the slot position.public final boolean isPromoted(int position)
ad link
at the slot position.
position
- the slot position.
ad link
at the slot position.public final int positionForAd(AdLink adLink)
ad link
in question and -1
if the
ad link
is not in the ranking.
adLink
- the ad link.
ad link
in question and -1
if the
ad link
is not in the ranking.public final int size()
public final java.lang.String toString()
toString
in class java.lang.Object
protected final void readWithLock(se.sics.isl.transport.TransportReader reader) throws java.text.ParseException
readWithLock
in class AbstractTransportable
reader
- the reader to read data from.
java.text.ParseException
- if an exception occurs while reading the slots.protected final void writeWithLock(se.sics.isl.transport.TransportWriter writer)
writeWithLock
in class AbstractTransportable
writer
- the writer to write data to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |