org.knime.core.node.property.hilite
Class DefaultHiLiteMapper

java.lang.Object
  extended by org.knime.core.node.property.hilite.DefaultHiLiteMapper
All Implemented Interfaces:
HiLiteMapper

public class DefaultHiLiteMapper
extends Object
implements HiLiteMapper

A default mapper for hilite translation which holds a map from RowKey to a set of RowKeys as value.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
DefaultHiLiteMapper(Map<RowKey,Set<RowKey>> map)
          Creates a new default hilite mapper.
 
Method Summary
 Set<RowKey> getKeys(RowKey key)
          Returns a set of RowKey elements which are associated by the specified key or null if no mapping is available.
 Set<RowKey> keySet()
          Returns an unmodifiable set of key (source) for hiliting.
static DefaultHiLiteMapper load(ConfigRO config)
          Restores the mapper from the config object that has been written using the save method.
 void save(ConfigWO config)
          Saves the settings in this mapper to a config object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHiLiteMapper

public DefaultHiLiteMapper(Map<RowKey,Set<RowKey>> map)
Creates a new default hilite mapper.

Parameters:
map - keeps the RowKey to set of RowKeys mapping
Method Detail

getKeys

public Set<RowKey> getKeys(RowKey key)
Returns a set of RowKey elements which are associated by the specified key or null if no mapping is available.

Specified by:
getKeys in interface HiLiteMapper
Parameters:
key - the key to get the mapping for
Returns:
a set of mapped RowKey elements

keySet

public Set<RowKey> keySet()
Returns an unmodifiable set of key (source) for hiliting.

Specified by:
keySet in interface HiLiteMapper
Returns:
A set of keys to hilite.

save

public void save(ConfigWO config)
Saves the settings in this mapper to a config object. Note that it writes directly to the passed root node of the config tree. It's good practice to open an local config object on which this method is invoked.

Parameters:
config - The config to write to.

load

public static DefaultHiLiteMapper load(ConfigRO config)
                                throws InvalidSettingsException
Restores the mapper from the config object that has been written using the save method.

Parameters:
config - To read from
Returns:
A new mapper based on the settings.
Throws:
InvalidSettingsException - If that fails.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.