fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue > Class Template Referenceabstract

Synchronized Hash for inserts/removes. More...

Public Member Functions

void clear ()
 Clears the synchronized hash. More...
 
boolean containsKey (TKey key)
 Return a value indicating whether ther Hash contains a value for a given key. More...
 
long getCount ()
 Gets the count of items in this hash. More...
 
TValue[] getValues ()
 Gets the values in the collection not subject to synchronization and Concurrent Modification/Access issues. More...
 
void insert (TKey key, TValue value)
 Synchronized insert into collection. More...
 
void remove (TKey key)
 Synchronized remove into collection. More...
 
boolean tryGetValue (TKey key, fm.liveswitch.Holder< TValue > value)
 Tries to get a value for a given key. More...
 

Protected Member Functions

 FrequentReadSynchronizedHash ()
 Creates an instance of a fm.liveswitch.FrequentReadSynchronizedList. More...
 
 FrequentReadSynchronizedHash (Object lockObject)
 Creates an instance of a fm.liveswitch.FrequentReadSynchronizedList. More...
 
abstract TValue[] getArray (int count)
 Gets an array of a given type of a given length. More...
 

Detailed Description

Synchronized Hash for inserts/removes.

Unsynchronized for reads. Optimized for frequent reads relative to writes.

Constructor & Destructor Documentation

◆ FrequentReadSynchronizedHash() [1/2]

◆ FrequentReadSynchronizedHash() [2/2]

fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.FrequentReadSynchronizedHash ( Object  lockObject)
protected

Creates an instance of a fm.liveswitch.FrequentReadSynchronizedList.

Parameters
lockObjectSynchronization object.

Member Function Documentation

◆ clear()

void fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.clear ( )

Clears the synchronized hash.

◆ containsKey()

boolean fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.containsKey ( TKey  key)

Return a value indicating whether ther Hash contains a value for a given key.

Parameters
keyThe key

◆ getArray()

abstract TValue [] fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.getArray ( int  count)
abstractprotected

Gets an array of a given type of a given length.

Parameters
count

◆ getCount()

long fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.getCount ( )

Gets the count of items in this hash.

◆ getValues()

TValue [] fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.getValues ( )

Gets the values in the collection not subject to synchronization and Concurrent Modification/Access issues.

May be missing newly added or removed values.

◆ insert()

void fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.insert ( TKey  key,
TValue  value 
)

Synchronized insert into collection.

Parameters
valueValue
keyKey

◆ remove()

void fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.remove ( TKey  key)

Synchronized remove into collection.

Parameters
keyKey

◆ tryGetValue()

boolean fm.liveswitch.FrequentReadSynchronizedHash< TKey, TValue >.tryGetValue ( TKey  key,
fm.liveswitch.Holder< TValue >  value 
)

Tries to get a value for a given key.

Parameters
keyThe key
valueThe value