Class AssociativeDataSwappableTable<KEY,VALUE,VALUECOLUMN>
java.lang.Object
com.illumon.iris.db.plot.datasets.data.AssociativeData<KEY,VALUE>
com.illumon.iris.db.plot.datasets.data.LiveAssociativeData<KEY,VALUE,VALUECOLUMN>
com.illumon.iris.db.plot.datasets.data.AssociativeDataSwappableTable<KEY,VALUE,VALUECOLUMN>
- All Implemented Interfaces:
PlotExceptionCause,SwappableTable.LocalTableUpdateListener,Serializable
public class AssociativeDataSwappableTable<KEY,VALUE,VALUECOLUMN>
extends LiveAssociativeData<KEY,VALUE,VALUECOLUMN>
implements SwappableTable.LocalTableUpdateListener
An
AssociativeData dataset backed by a SwappableTable. Table columns hold the keys and
associated values.
Data types are specified in construction.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAssociativeDataSwappableTable(DataChangeListener dataChangeListener, SwappableTable swappableTable, String keyColumn, String valueColumn, Class<KEY> keyColumnType, Class<VALUECOLUMN> valueColumnType, PlotInfo plotInfo) Creates an AssociativeDataSwappableTable instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the value associated with the keybooleanWhether the dataset is modifiable.voidonClose()Tear down once a figure is removed.voidonLocalTableUpdate(Table localTable) Updates this listener with the new table.voidAdds the key-value pair to the dataset.Adds all key-value pairs in the map to the dataset.snapshot()Methods inherited from class com.illumon.iris.db.plot.datasets.data.LiveAssociativeData
constructSnapshot, convertMethods inherited from class com.illumon.iris.db.plot.datasets.data.AssociativeData
getPlotInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.plot.util.tables.SwappableTable.LocalTableUpdateListener
onInitialSnapshot
-
Constructor Details
-
AssociativeDataSwappableTable
public AssociativeDataSwappableTable(DataChangeListener dataChangeListener, SwappableTable swappableTable, String keyColumn, String valueColumn, Class<KEY> keyColumnType, Class<VALUECOLUMN> valueColumnType, PlotInfo plotInfo) Creates an AssociativeDataSwappableTable instance. TheswappableTablemust have had a lastBy applied! Keys are held in thekeyColumnofswappableTable. Their associated values are held in thevalueColumn. The data type of the keys is specified bykeyColumnType. The data type of the values is specified byvalueColumnType.- Parameters:
dataChangeListener- listener for data changes in this seriesswappableTable- table. Must have a lastBy applied.keyColumn- column inswappableTablewhich holds the key valuesvalueColumn- column inswappableTablewhich holds the values associated with the keyskeyColumnType- data type of the keysvalueColumnType- data type of the valuesplotInfo- plot information- Throws:
com.fishlib.base.verify.RequirementFailure-swappableTable,keyColumn, andvalueColumnmust not be nullIllegalArgumentException-keyColumnandvalueColumnmust be columns inswappableTableRuntimeException- the specified data types must match the data types of the corresponding columns
-
-
Method Details
-
onLocalTableUpdate
Description copied from interface:SwappableTable.LocalTableUpdateListenerUpdates this listener with the new table.- Specified by:
onLocalTableUpdatein interfaceSwappableTable.LocalTableUpdateListener- Parameters:
localTable- table
-
get
Description copied from class:AssociativeDataGets the value associated with the key- Specified by:
getin classAssociativeData<KEY,VALUE> - Parameters:
key- key- Returns:
- value associated with the key
-
isModifiable
public boolean isModifiable()Description copied from class:AssociativeDataWhether the dataset is modifiable.- Specified by:
isModifiablein classAssociativeData<KEY,VALUE> - Returns:
- true if the dataset is modifiable, false if not
-
put
Description copied from class:AssociativeDataAdds the key-value pair to the dataset.- Specified by:
putin classAssociativeData<KEY,VALUE> - Parameters:
key- keyvalue- value
-
putAll
Description copied from class:AssociativeDataAdds all key-value pairs in the map to the dataset.- Specified by:
putAllin classAssociativeData<KEY,VALUE> - Type Parameters:
K- type of the keys invaluesV- type of the values invalues- Parameters:
values- keypair map
-
onClose
public void onClose()Description copied from class:AssociativeDataTear down once a figure is removed.- Overrides:
onClosein classAssociativeData<KEY,VALUE>
-
snapshot
- Specified by:
snapshotin classLiveAssociativeData<KEY,VALUE, VALUECOLUMN>
-