swarm.collections
Interface ListShuffler
- All Known Implementing Classes:
- ListShufflerImpl
- public abstract interface ListShuffler
- extends CreateS, Create, DropS, Drop
A class to randomize the order of a given Swarm List.
ListShuffler randomizes the order of the elements in a List; either the whole list or the num lowest elements. The list must be supplied. An uniform distribution can be supplied, or the system- supplied uniformUnsRand is used. The algorithm is from Knuth. All these methods modify the underlying collection, so any indexes should always be regenerated.
Methods inherited from interface swarm.defobj.Drop |
drop |
Methods inherited from interface swarm.defobj.DefinedObject |
compare,
describe,
describeID,
getDisplayName,
getTypeName,
getZone,
perform,
perform$with,
perform$with$with,
perform$with$with$with,
respondsTo,
setDisplayName,
xfprint,
xfprintid,
xprint,
xprintid |
shuffleWholeList
public Object shuffleWholeList(Object list)
- the shuffleWholeList method randomizes the whole list.
shufflePartialList$Num
public Object shufflePartialList$Num(Object list,
int num)
- the shufflePartialList:Num method randomizes the order of the 'num' lowest elements of the list, or the whole list if (num > size of list).