Search this API

y.util
Class Maps.HighPerformanceBoolMap

java.lang.Object
  extended by y.util.Maps.HighPerformanceBoolMap
All Implemented Interfaces:
DataAcceptor, DataMap, DataProvider, EdgeMap, NodeMap
Enclosing class:
Maps

public static final class Maps.HighPerformanceBoolMap
extends java.lang.Object
implements NodeMap, EdgeMap

Implementation of a resettable high performance map for values of simple type boolean. A high performance map is a facade to another map which will allow to reset all bound values to a default value in constant time.

 

Constructor Summary
Maps.HighPerformanceBoolMap(DataMap backingMap, boolean defaultValue)
           
Maps.HighPerformanceBoolMap(DataProvider backingProvider, DataAcceptor backingAcceptor, boolean defaultValue)
           
 
Method Summary
 java.lang.Object get(java.lang.Object dataHolder)
          Returns the value bound to the given node.
 boolean getBool(java.lang.Object dataHolder)
          Returns the boolean value bound to the given node.
 double getDouble(java.lang.Object dataHolder)
          Returns the double value bound to the given node.
 int getInt(java.lang.Object dataHolder)
          Returns the integer value bound to the given node.
 void resetAll(boolean defaultValue)
          Resets all values to the given default value in constant time.
 void set(java.lang.Object dataHolder, java.lang.Object value)
          Associates the given value to the given node.
 void setBool(java.lang.Object dataHolder, boolean value)
          Associates the given boolean value to the given node.
 void setDouble(java.lang.Object dataHolder, double value)
          Associates the given double value to the given node.
 void setInt(java.lang.Object dataHolder, int value)
          Associates the given integer value to the given node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Maps.HighPerformanceBoolMap

public Maps.HighPerformanceBoolMap(DataMap backingMap,
                                   boolean defaultValue)

Maps.HighPerformanceBoolMap

public Maps.HighPerformanceBoolMap(DataProvider backingProvider,
                                   DataAcceptor backingAcceptor,
                                   boolean defaultValue)
Method Detail

resetAll

public void resetAll(boolean defaultValue)
Resets all values to the given default value in constant time.

Parameters:
defaultValue - the new default value

get

public java.lang.Object get(java.lang.Object dataHolder)
Description copied from interface: NodeMap
Returns the value bound to the given node.

Specified by:
get in interface DataProvider
Specified by:
get in interface EdgeMap
Specified by:
get in interface NodeMap

set

public void set(java.lang.Object dataHolder,
                java.lang.Object value)
Description copied from interface: NodeMap
Associates the given value to the given node.

Specified by:
set in interface DataAcceptor
Specified by:
set in interface EdgeMap
Specified by:
set in interface NodeMap

getBool

public boolean getBool(java.lang.Object dataHolder)
Description copied from interface: NodeMap
Returns the boolean value bound to the given node.

Specified by:
getBool in interface DataProvider
Specified by:
getBool in interface EdgeMap
Specified by:
getBool in interface NodeMap

getDouble

public double getDouble(java.lang.Object dataHolder)
Description copied from interface: NodeMap
Returns the double value bound to the given node.

Specified by:
getDouble in interface DataProvider
Specified by:
getDouble in interface EdgeMap
Specified by:
getDouble in interface NodeMap

getInt

public int getInt(java.lang.Object dataHolder)
Description copied from interface: NodeMap
Returns the integer value bound to the given node.

Specified by:
getInt in interface DataProvider
Specified by:
getInt in interface EdgeMap
Specified by:
getInt in interface NodeMap

setBool

public void setBool(java.lang.Object dataHolder,
                    boolean value)
Description copied from interface: NodeMap
Associates the given boolean value to the given node.

Specified by:
setBool in interface DataAcceptor
Specified by:
setBool in interface EdgeMap
Specified by:
setBool in interface NodeMap

setDouble

public void setDouble(java.lang.Object dataHolder,
                      double value)
Description copied from interface: NodeMap
Associates the given double value to the given node.

Specified by:
setDouble in interface DataAcceptor
Specified by:
setDouble in interface EdgeMap
Specified by:
setDouble in interface NodeMap

setInt

public void setInt(java.lang.Object dataHolder,
                   int value)
Description copied from interface: NodeMap
Associates the given integer value to the given node.

Specified by:
setInt in interface DataAcceptor
Specified by:
setInt in interface EdgeMap
Specified by:
setInt in interface NodeMap

© Copyright 2000-2017,
yWorks GmbH.
All rights reserved.