public interface TableMap extends Deflatable<TableMap>, TransformableTableMap, LivenessNode
Modifier and Type | Interface and Description |
---|---|
static interface |
TableMap.KeyListener
Table map key change listener.
|
static interface |
TableMap.Listener
Table map change listener.
|
TransformableTableMap.AsTableBuilder
Modifier and Type | Method and Description |
---|---|
void |
addKeyListener(TableMap.KeyListener listener)
Listen to changes in the map's keys.
|
void |
addListener(TableMap.Listener listener)
Add a new listener for changes to the map.
|
<R> R |
apply(com.fishlib.base.Function.Unary<R,TableMap> function)
Applies a function to this tableMap.
|
default TableMap |
asTableMap()
If you're a TableMap return this, otherwise if you're a Proxy return the underlying TableMap.
|
default Inflatable<TableMap> |
deflate(ExportedObjectClient client) |
static TableMap |
emptyMap() |
TableMap |
flatten()
Flattens all of the result tables within the tablemap.
|
Table |
get(Object key)
Gets a table with a given key.
|
Object[] |
getKeySet()
Gets the keys.
|
Table |
getWithTransform(Object key,
Function<Table,Table> transform)
Gets a table with a given key, applying the specified transform before returning.
|
TableMap |
populateKeys(Object... keys)
When creating the table map, some of the keys that we would like to be there eventually may not exist.
|
TableMap |
preemptiveUpdatesTable(int intervalMillis)
Creates preemptive tables out of all of the result tables within the tablemap.
|
void |
removeKeyListener(TableMap.KeyListener listener) |
void |
removeListener(TableMap.Listener listener)
Removes a map change listener.
|
int |
size()
Number of tables in the map.
|
TableMap |
transformTables(Function<Table,Table> function)
Applies a transformation function on all tables in the TableMap, producing a new TableMap which will update as
new keys are added.
|
TableMap |
transformTablesWithMap(TableMap otherMap,
BiFunction<Table,Table,Table> function)
Applies a BiFunction function on all tables in this TableMap and otherMap that have matching keys, producing a
new TableMap which will update as new keys are added.
|
Collection<Table> |
values()
Gets the values.
|
maybeDeflate
asTable, asTable, asTableBuilder, merge
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
manage, tryManage
static TableMap emptyMap()
Table get(Object key)
LivenessManager
(see LivenessScopeStack
) to manage the result if non-null.key
- keyTable getWithTransform(Object key, Function<Table,Table> transform)
key
- keyObject[] getKeySet()
Collection<Table> values()
int size()
TableMap populateKeys(Object... keys)
keys
- the keys to add to the mapvoid addListener(TableMap.Listener listener)
listener
- map change listenervoid removeListener(TableMap.Listener listener)
listener
- map change listener.void addKeyListener(TableMap.KeyListener listener)
listener
- key change listenervoid removeKeyListener(TableMap.KeyListener listener)
TableMap flatten()
TableMap preemptiveUpdatesTable(int intervalMillis)
intervalMillis
- update interval for the preemptive tables<R> R apply(com.fishlib.base.Function.Unary<R,TableMap> function)
R
- the return type of functionfunction
- the function to run, its single argument will be this table map.TableMap transformTables(Function<Table,Table> function)
function
- the function to apply to each table in this TableMapTableMap transformTablesWithMap(TableMap otherMap, BiFunction<Table,Table,Table> function)
otherMap
- the other TableMapfunction
- the function to apply to each table in this TableMap, the tables in this map are the first argument
the tables in the other map are the second argument.default TableMap asTableMap()
TransformableTableMap
asTableMap
in interface TransformableTableMap
default Inflatable<TableMap> deflate(@NotNull ExportedObjectClient client)
deflate
in interface Deflatable<TableMap>