|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectCollectionUtils
public class CollectionUtils
Contains methods for working with Collections.
Nested Class Summary | |
---|---|
static class |
CollectionUtils.SortEntitiesByDistance
A Comparator that sorts CombatEntityAPI s by distance from a Vector2f . |
static class |
CollectionUtils.SortObjectivesByDistance
Deprecated. Use CollectionUtils.SortEntitiesByDistance instead. |
static class |
CollectionUtils.SortTokensByDistance
A Comparator that sorts SectorEntityToken s by distance from a Vector2f . |
Method Summary | ||
---|---|---|
static String |
implode(Collection toImplode)
Creates a comma-separated String from a Collection 's entries. |
|
static String |
implode(Collection toImplode,
String separator)
Combines and separates a Collection of String s. |
|
static
|
weightedRandom(Map<T,Float> pickFrom)
Deprecated. Use com.fs.starfarer.api.util.WeightedRandomPicker
instead. |
|
static
|
weightedRandom(Map<T,Float> pickFrom,
int numToPick)
Deprecated. Use com.fs.starfarer.api.util.WeightedRandomPicker
instead (call pick() multiple times). |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String implode(Collection toImplode, String separator)
Collection
of String
s. Useful for comma-separated lists.
toImplode
- A Collection
whose contents should be combined
into one String
.separator
- The separator character to split toImplode
with.
String
consisting of toImplode
's values
separated with separator
.public static String implode(Collection toImplode)
String
from a Collection
's entries.
toImplode
- A Collection
to be combined (using each
entry's toString
method).
String
consisting of toImplode
's values
separated with commas.implode(java.util.Collection, java.lang.String)
@Deprecated public static <T> List<T> weightedRandom(Map<T,Float> pickFrom, int numToPick)
com.fs.starfarer.api.util.WeightedRandomPicker
instead (call pick() multiple times).
@Deprecated public static <T> T weightedRandom(Map<T,Float> pickFrom)
com.fs.starfarer.api.util.WeightedRandomPicker
instead.
|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |