Uses of Class
squidpony.squidmath.K2
Package | Description |
---|---|
squidpony |
Utilities that don't fit elsewhere in SquidLib; mostly text manipulation, compression, and helper code.
|
squidpony.squidmath |
A very broad package containing random number generators, geometry tools, data structures, and noise functions.
|
-
Uses of K2 in squidpony
Fields in squidpony declared as K2 Modifier and Type Field Description static K2<StringConvert,CharSequence[]>
StringConvert. registry
Methods in squidpony that return K2 Modifier and Type Method Description static <A, B> K2<A,B>
Maker. makeK2()
Makes an empty K2 (two-key set/bimap); needs A and B key types to be specified in order to work.static <A, B> K2<A,B>
Maker. makeK2(float factor, A a0, B b0, Object... rest)
Makes a K2 (two-key set/bimap) with the given load factor (which should be between 0.1 and 0.9), A and B key types inferred from the types of a0 and b0, and considers all parameters A-B pairs, casting the Objects at positions 0, 2, 4...static <A, B> K2<A,B>
Maker. makeK2(A a0, B b0, Object... rest)
Makes a K2 (two-key set/bimap) with A and B key types inferred from the types of a0 and b0, and considers all parameters A-B pairs, casting the Objects at positions 0, 2, 4... -
Uses of K2 in squidpony.squidmath
Methods in squidpony.squidmath that return K2 Modifier and Type Method Description K2<A,B>
K2. alterA(A past, A future)
Changes an existing A key,past
, to another A key,future
, if past exists in this K2 and future does not yet exist in this K2.K2<A,B>
K2. alterAAt(int index, A future)
Changes the A key atindex
to another A key,future
, if index is valid and future does not yet exist in this K2.K2<A,B>
K2. alterB(B past, B future)
Changes an existing B key,past
, to another B key,future
, if past exists in this K2 and future does not yet exist in this K2.K2<A,B>
K2. alterBAt(int index, B future)
Changes the B key atindex
to another B key,future
, if index is valid and future does not yet exist in this K2.K2<A,B>
K2. removeA(A removing)
Removes a given A key, ifremoving
exists in this K2's A keys, and also removes any keys associated with its point in the ordering.K2<A,B>
K2. removeAt(int index)
Removes a given point in the ordering, ifindex
is at least 0 and less thansize()
.K2<A,B>
K2. removeB(B removing)
Removes a given B key, ifremoving
exists in this K2's B keys, and also removes any keys associated with its point in the ordering.K2<A,B>
K2. reorder(int... ordering)
Reorders this K2 usingordering
, which have the same length as this K2'ssize()
and can be generated withArrayTools.range(int)
(which, if applied, would produce no change to the current ordering),IRNG.randomOrdering(int)
(which gives a random ordering, and if applied immediately would be the same as callingshuffle(IRNG)
), or made in some other way.K2<A,B>
K2. shuffle(IRNG rng)
Generates a random ordering with rng and applies the same ordering to all kinds of keys this has; they will maintain their current association to other keys but their ordering/indices will change.