Kieker 1.9

kieker.common.util.registry
Class Lookup<E>

java.lang.Object
  extended by kieker.common.util.registry.Lookup<E>
Type Parameters:
E - the type of the objects
All Implemented Interfaces:
ILookup<E>, IRegistry<E>

public final class Lookup<E>
extends Object
implements ILookup<E>

Since:
1.8
Author:
Jan Waller

Constructor Summary
Lookup()
           
 
Method Summary
 int get(E value)
          Gets a unique id for an object.
 E get(int i)
          Gets the object associated with the unique id.
 E[] getAll()
          Return an array with all registered objects.
 E getNonBlocking(int i)
           
 int getSize()
          Returns the number of registered objects.
 boolean set(E value, int id)
          Registers the object with the unique id.
 void setRecordReceiver(IMonitoringRecordReceiver recordReceiver)
          Deprecated. 
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lookup

public Lookup()
Method Detail

get

public int get(E value)
Description copied from interface: IRegistry
Gets a unique id for an object.

Specified by:
get in interface IRegistry<E>
Parameters:
value - the object
Returns:
the unique id

getNonBlocking

public E getNonBlocking(int i)

getAll

public E[] getAll()
Description copied from interface: IRegistry
Return an array with all registered objects.

Specified by:
getAll in interface IRegistry<E>
Returns:
array of registered objects

getSize

public int getSize()
Description copied from interface: IRegistry
Returns the number of registered objects.

Specified by:
getSize in interface IRegistry<E>
Returns:
number of registered objects

get

public E get(int i)
Description copied from interface: IRegistry
Gets the object associated with the unique id.

Specified by:
get in interface IRegistry<E>
Parameters:
i - the unique id
Returns:
the associated object

set

public boolean set(E value,
                   int id)
Description copied from interface: ILookup
Registers the object with the unique id.

Specified by:
set in interface ILookup<E>
Parameters:
value - the object
id - the unique id
Returns:
false on duplicate id

setRecordReceiver

@Deprecated
public void setRecordReceiver(IMonitoringRecordReceiver recordReceiver)
Deprecated. 

Description copied from interface: IRegistry
Enables logging of newly registered objects. Must only be called for E == String

Specified by:
setRecordReceiver in interface IRegistry<E>
Parameters:
recordReceiver - the IMonitoringRecordReceiver logged to

Kieker 1.9

Copyright 2014 Kieker Project, http://kieker-monitoring.net