swarm.collections
Interface ListShuffler
- All Known Implementing Classes:
- ListShufflerImpl
- public interface ListShuffler
- extends Create, CreateS, Drop, DropS
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.
Method Summary |
java.lang.Object |
shufflePartialList$Num(java.lang.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). |
java.lang.Object |
shuffleWholeList(java.lang.Object list)
the shuffleWholeList method randomizes the whole list. |
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 java.lang.Object shuffleWholeList(java.lang.Object list)
- the shuffleWholeList method randomizes the whole list.
shufflePartialList$Num
public java.lang.Object shufflePartialList$Num(java.lang.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).