Search this API

y.util
Class Maps.HighPerformanceDoubleMap

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

public static final class Maps.HighPerformanceDoubleMap
extends Object
implements NodeMap, EdgeMap

Implementation of a resettable high performance map for values of simple type double. 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.HighPerformanceDoubleMap(DataMap backingMap, double defaultValue)
           
Maps.HighPerformanceDoubleMap(DataProvider backingProvider, DataAcceptor backingAcceptor, double defaultValue)
           
 
Method Summary
 Object get(Object dataHolder)
          Returns an object value associated with the given data holder.
 boolean getBool(Object dataHolder)
          Returns a boolean value associated with the given data holder.
 double getDouble(Object dataHolder)
          Returns a double value associated with the given data holder.
 int getInt(Object dataHolder)
          Returns an integer value associated with the given data holder.
 void resetAll(double defaultValue)
          Resets all values to the given default value in constant time.
 void set(Object dataHolder, Object value)
          Sets an object value associated with the given data holder.
 void setBool(Object dataHolder, boolean value)
          Sets a boolean value associated with the given data holder.
 void setDouble(Object dataHolder, double value)
          Sets a double value associated with the given data holder.
 void setInt(Object dataHolder, int value)
          Sets an integer value associated with the given data holder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Maps.HighPerformanceDoubleMap

public Maps.HighPerformanceDoubleMap(DataMap backingMap,
                                     double defaultValue)

Maps.HighPerformanceDoubleMap

public Maps.HighPerformanceDoubleMap(DataProvider backingProvider,
                                     DataAcceptor backingAcceptor,
                                     double defaultValue)
Method Detail

resetAll

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

Parameters:
defaultValue - the new default value

get

public Object get(Object dataHolder)
Description copied from interface: DataProvider
Returns an object value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

set

public void set(Object dataHolder,
                Object value)
Description copied from interface: DataAcceptor
Sets an object value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

getBool

public boolean getBool(Object dataHolder)
Description copied from interface: DataProvider
Returns a boolean value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

getDouble

public double getDouble(Object dataHolder)
Description copied from interface: DataProvider
Returns a double value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

getInt

public int getInt(Object dataHolder)
Description copied from interface: DataProvider
Returns an integer value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

setBool

public void setBool(Object dataHolder,
                    boolean value)
Description copied from interface: DataAcceptor
Sets a boolean value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

setDouble

public void setDouble(Object dataHolder,
                      double value)
Description copied from interface: DataAcceptor
Sets a double value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

setInt

public void setInt(Object dataHolder,
                   int value)
Description copied from interface: DataAcceptor
Sets an integer value associated with the given data holder. This method may throw an UnsupportedOperationException.

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

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