|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.webSvr.exhibit.BuiltInFilters.sortRandomN
public static final class BuiltInFilters.sortRandomN
Selects N exhibits at random and randomises their order. If the number of exhibits is less than N then this returns all the exhibits.
The first value is the unsigned, positive, base-ten integer value of N.
If the second argument is missing or null then the random number sequence used is taken differently each time we run, else the hash of the second string is taken as the random number seed.
| Field Summary | |
|---|---|
private int |
n
The upper bound on result size. |
private java.lang.String |
seed
The seed; if null we use a non-repeatable source. |
private static long |
serialVersionUID
Unique serial ID. |
| Constructor Summary | |
|---|---|
BuiltInFilters.sortRandomN(int count,
java.lang.String hashSrc)
More efficient programmatic constructor. |
|
BuiltInFilters.sortRandomN(java.lang.String[] args)
Takes exactly one or two arguments. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Equality depends on identical seeds and result size. |
int |
hashCode()
Hash depends on the seed and the result size limit. |
Name.ExhibitFull[] |
sort(AllExhibitProperties aep,
Name.ExhibitFull[] exhibitNames)
Sorts the given exhibits (specified by full name) in situ; never null. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private final int n
private final java.lang.String seed
| Constructor Detail |
|---|
public BuiltInFilters.sortRandomN(java.lang.String[] args)
The second argument, if absent or null, indicates that a different random number sequence is used on each run. If present and non-null then its hash is used to seed a random number generator to give repeatable results.
public BuiltInFilters.sortRandomN(int count,
java.lang.String hashSrc)
| Method Detail |
|---|
public Name.ExhibitFull[] sort(AllExhibitProperties aep,
Name.ExhibitFull[] exhibitNames)
SortIF
sort in interface SortIFpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||