com.clarkparsia.pellet.util
Class DataMap

java.lang.Object
  extended by com.clarkparsia.pellet.util.DataMap

public class DataMap
extends java.lang.Object

An object that maps keys to values in a type-safe manner. A key cannot be mapped to multiple values. Each key specifies the Java Object allowed for the values of the key. Neither null keys nor null values are allowed.

Author:
Evren Sirin

Constructor Summary
DataMap()
           
 
Method Summary
<V> boolean
contains(DataKey<V> key)
           
<V> V
get(DataKey<V> key)
          Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
<V> V
remove(DataKey<V> key)
           
<V> V
set(DataKey<V> key, V value)
          Associates the specified value with the specified key in this map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataMap

public DataMap()
Method Detail

get

public <V> V get(DataKey<V> key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Type Parameters:
V - Allowed types for the specified key
Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped, or null if this map contains no mapping for the key

set

public <V> V set(DataKey<V> key,
                 V value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.

Type Parameters:
V - allowed types for this key
Parameters:
key - the key to identify the data value
value - the new data value to associate with the key
Returns:
the previous data value associated with the key or null if there was no previous value

contains

public <V> boolean contains(DataKey<V> key)

remove

public <V> V remove(DataKey<V> key)


Copyright 2010 Clark & Parsia, LLC. All Rights Reserved.