|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.props.GenProps.SimpleAd
private static final class GenProps.SimpleAd
Class holding details of one simple banner advertisement; immutable, serialisable. Weighting must be strictly positive integer; text must be non-zero-length, 7-bit printable (32--126) ASCII/HTML data, though we also allow CRLF (\r\n) for tricky JavaScript/HTML issues...
We assume that the on-the-wire format for members is reasonably efficient, especially if the transport layer includes compression.
This supports equals(), hashCode() and compareTo(); two objects are equal if all their fields are, and the sort order is to minimise ad-lookup and HTML-bandwidth (ie by highest weight then smallest code, with ties being broken by code lexical ordering).
| Field Summary | |
|---|---|
(package private) java.lang.String |
code
HTML code as 7-bit ASCII; non-null, non-zero length. |
static int |
MAX_AD_CHARACTERS
Maximum HTML code length in bytes/characters. |
private static long |
serialVersionUID
Our serialisation version. |
(package private) int |
weight
Strictly positive weighting. |
| Constructor Summary | |
|---|---|
GenProps.SimpleAd(int adRelativeWeight,
java.lang.String HTMLCode)
Construct new simple ad details. |
|
| Method Summary | |
|---|---|
int |
compareTo(GenProps.SimpleAd o)
Provides total ordering, with primary sort by decreasing weight. |
boolean |
equals(java.lang.Object o)
Equality depends on all fields. |
int |
hashCode()
Hash depends on text as good source of variability. |
protected java.lang.Object |
readResolve()
Deserialise: validate and eliminate duplicates coming off the wire. |
void |
validateObject()
Validate fields/state. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final int weight
final java.lang.String code
public static final int MAX_AD_CHARACTERS
private static final long serialVersionUID
| Constructor Detail |
|---|
GenProps.SimpleAd(int adRelativeWeight,
java.lang.String HTMLCode)
| Method Detail |
|---|
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(GenProps.SimpleAd o)
compareTo in interface java.lang.Comparable<GenProps.SimpleAd>protected java.lang.Object readResolve()
public void validateObject()
throws java.io.InvalidObjectException
validateObject in interface java.io.ObjectInputValidationjava.io.InvalidObjectException
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||