fm.liveswitch.FrequentReadSynchronizedList< T > Class Template Referenceabstract

Synchronized List for inserts/removes. More...

Public Member Functions

void add (T value)
 Synchronized insert into collection at the end of the list. More...
 
void clear ()
 Clears the list. More...
 
long getCount ()
 Gets the count of items in the list. More...
 
T[] getValues ()
 Gets the values in the collection not subject to synchronization and Concurrent Modification/Access issues. More...
 
void insert (int index, T value)
 Synchronized insert into collection at a given index. More...
 
void remove (T value)
 Synchronized remove from collection. More...
 
void removeAt (int index)
 Synchronized remove from collection at a specified index. More...
 

Protected Member Functions

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

Detailed Description

Synchronized List for inserts/removes.

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

Constructor & Destructor Documentation

◆ FrequentReadSynchronizedList() [1/2]

◆ FrequentReadSynchronizedList() [2/2]

Creates an instance of a fm.liveswitch.FrequentReadSynchronizedList.

Parameters
lockObjectSynchronization object.

Member Function Documentation

◆ add()

void fm.liveswitch.FrequentReadSynchronizedList< T >.add ( value)

Synchronized insert into collection at the end of the list.

Parameters
valueValue

◆ clear()

Clears the list.

◆ getArray()

abstract T [] fm.liveswitch.FrequentReadSynchronizedList< T >.getArray ( int  count)
abstractprotected

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

Parameters
countThe count.

◆ getCount()

Gets the count of items in the list.

◆ 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.FrequentReadSynchronizedList< T >.insert ( int  index,
value 
)

Synchronized insert into collection at a given index.

Parameters
valueValue
indexIndex

◆ remove()

void fm.liveswitch.FrequentReadSynchronizedList< T >.remove ( value)

Synchronized remove from collection.

Parameters
valueValue

◆ removeAt()

void fm.liveswitch.FrequentReadSynchronizedList< T >.removeAt ( int  index)

Synchronized remove from collection at a specified index.

Parameters
indexIndex