dk.deepthought.sidious.util
Class SidiousMap

java.lang.Object
  extended by dk.deepthought.sidious.util.SidiousMap

@ThreadSafe
public class SidiousMap
extends java.lang.Object

This class implements the synchronized access functionality of a HashMap.

Author:
Deepthought
See Also:
HashMap

Field Summary
private  java.util.Map<SuperLinkID,PlanRequester> map
          Internal map instance.
 
Constructor Summary
SidiousMap()
          Empty default constructor.
 
Method Summary
 PlanRequester get(SuperLinkID id)
          Returns the PlanRequester to which the specified id is mapped in this identity map, or null if the map contains no mapping for this id.
 PlanRequester put(SuperLinkID id, PlanRequester requester)
          Associates the specified id with the specified requester in this map.
 void remove(SuperLinkID id)
          Removes the mapping for this key from this map if it is present.
 int size()
          Returns the number of key-value mappings in this sidious map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private final java.util.Map<SuperLinkID,PlanRequester> map
Internal map instance.

Constructor Detail

SidiousMap

public SidiousMap()
Empty default constructor.

Method Detail

get

public PlanRequester get(SuperLinkID id)
Returns the PlanRequester to which the specified id is mapped in this identity map, or null if the map contains no mapping for this id.

Parameters:
id - the id whose associated requester is to be returned
Returns:
the requester to which this map maps the specified id, or null if the map contains no mapping for this id

put

public PlanRequester put(SuperLinkID id,
                         PlanRequester requester)
Associates the specified id with the specified requester in this map. If the map previously contained a mapping for this id, the old requester is replaced.

Parameters:
id - key with which the specified requester is to be associated
requester - value to be associated with the specified id
Returns:
the value previously associated with the id, null if the map did not previously contain a mapping for this id.

remove

public void remove(SuperLinkID id)
Removes the mapping for this key from this map if it is present.

Parameters:
id - the id for whic to remove the mapping

size

public int size()
Returns the number of key-value mappings in this sidious map.

Returns:
the number of key-value mappings in this map.


Copyright © Deepthought Development - All Rights Reserved.