de.cau.cs.kieler.sim.table.views
Class TableDataList

java.lang.Object
  extended by de.cau.cs.kieler.sim.table.views.TableDataList

public class TableDataList
extends Object

The class TableDataList implements a list of TableData elements that are the input of the DataTableViewer. This list is modified by the producer and observer DataComponent.

Rating red

Constructor Summary
TableDataList(DataTableViewer viewerParam)
          Instantiates a new TableDataList.
 
Method Summary
 void add(TableData tableData)
          Adds a TableData entry to the list.
 boolean contains(String key)
          Checks whether the list contains a TableData entry with the specific key.
 boolean containsOther(String key, TableData tableData)
          Checks whether the list contains a duplicate TableData entry with the same key as the provided one.
 TableData get(int index)
          Gets a TableData entry with a specific index as an identifier.
 TableData get(String key)
          Gets a TableData entry with a specific key as an identifier.
 TableData[] getArray()
          Gets the list of TableData entries as an array of TableData entries.
static TableDataList getInstance()
          Gets the single instance of this TableDataList class.
 int indexOf(TableData tableData)
          Returns the index of an TableData entry.
 void remove(String key)
          Removes the TableData entry with the specific key from list.
 void resetModified()
          Resets the modified flag of an entry to false.
 int size()
          Gets the size of this list.
 void updateViewAsync()
          Updates the view of the parent tree table viewer asynchronously.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDataList

public TableDataList(DataTableViewer viewerParam)
Instantiates a new TableDataList.

Parameters:
viewerParam - the parent tree table viewer for refreshes
Method Detail

indexOf

public int indexOf(TableData tableData)
Returns the index of an TableData entry.

Parameters:
tableData - the TableData entry
Returns:
the index

resetModified

public void resetModified()
Resets the modified flag of an entry to false.


updateViewAsync

public void updateViewAsync()
Updates the view of the parent tree table viewer asynchronously.


add

public void add(TableData tableData)
Adds a TableData entry to the list.

Parameters:
tableData - the TableData entry

get

public TableData get(String key)
Gets a TableData entry with a specific key as an identifier.

Parameters:
key - the identifier key
Returns:
the TableData entry

get

public TableData get(int index)
Gets a TableData entry with a specific index as an identifier.

Parameters:
index - the identifier index
Returns:
the TableData entry

contains

public boolean contains(String key)
Checks whether the list contains a TableData entry with the specific key.

Parameters:
key - the identifier key
Returns:
true, if list contains that TableData entry

containsOther

public boolean containsOther(String key,
                             TableData tableData)
Checks whether the list contains a duplicate TableData entry with the same key as the provided one.

Parameters:
key - the identifier key
tableData - the TableData entry
Returns:
true, if list contains another TableData entry

remove

public void remove(String key)
Removes the TableData entry with the specific key from list.

Parameters:
key - the identifier key

getInstance

public static TableDataList getInstance()
Gets the single instance of this TableDataList class.

Returns:
single instance of TableDataList

size

public int size()
Gets the size of this list.

Returns:
the size

getArray

public TableData[] getArray()
Gets the list of TableData entries as an array of TableData entries.

Returns:
the TableData[] array