nl.tudelft.simulation.dsol.eventlists
Class TableModelEventList

java.lang.Object
  extended by nl.tudelft.simulation.dsol.eventlists.RedBlackTree
      extended by nl.tudelft.simulation.dsol.eventlists.TableModelEventList
All Implemented Interfaces:
Serializable, EventListInterface

public class TableModelEventList
extends RedBlackTree

A TableModel implementation of an eventlist is an extionsion of the eventlist which upholds its own TableModel. This implementation is used to graphically display the events in the tree.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.0
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:21:28 $
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
static EventType EVENTLIST_CHANCED_EVENT
          The EVENTLIST_CHANGED_EVENT
static String[] HEADER
          The tableHeader
 
Fields inherited from class nl.tudelft.simulation.dsol.eventlists.RedBlackTree
BLACK, modCount, RED, root, size
 
Constructor Summary
TableModelEventList(EventListInterface origin)
          constructs a new TableModelEventList
 
Method Summary
 boolean add(SimEventInterface value)
          adds an event to the eventlist
 boolean addAll(Collection collection)
          adds a collection of events to the tree
 void clear()
          clears the eventlist by removing all its scheduled events.
 EventListInterface getOrigin()
          returns the TreeMapEventList
 TableModel getTableModel()
          returns the tableModel
 boolean remove(SimEventInterface value)
          removes the event from this tree
 boolean removeAll(Collection collection)
          removes a collection of events from this tree
 SimEventInterface removeFirst()
          removes the first event from the eventlist.
 SimEventInterface removeLast()
          removes the last event from the eventlist.
 void setShowPackage(boolean showPackage)
          sets the showPackage
 
Methods inherited from class nl.tudelft.simulation.dsol.eventlists.RedBlackTree
contains, containsAll, deleteEntry, first, firstEntry, isEmpty, iterator, last, size, successor, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENTLIST_CHANCED_EVENT

public static final EventType EVENTLIST_CHANCED_EVENT
The EVENTLIST_CHANGED_EVENT


HEADER

public static final String[] HEADER
The tableHeader

Constructor Detail

TableModelEventList

public TableModelEventList(EventListInterface origin)
constructs a new TableModelEventList

Parameters:
origin - the origin
Method Detail

getOrigin

public EventListInterface getOrigin()
returns the TreeMapEventList

Returns:
EventListenerInterface

getTableModel

public TableModel getTableModel()
returns the tableModel

Returns:
TableModel resutl

setShowPackage

public void setShowPackage(boolean showPackage)
sets the showPackage

Parameters:
showPackage - The showPackage to set.

add

public boolean add(SimEventInterface value)
Description copied from interface: EventListInterface
adds an event to the eventlist

Specified by:
add in interface EventListInterface
Overrides:
add in class RedBlackTree
Parameters:
value - the event to add
Returns:
true whenever the event was not already scheduled.
See Also:
#add(nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface)

addAll

public boolean addAll(Collection collection)
Description copied from interface: EventListInterface
adds a collection of events to the tree

Specified by:
addAll in interface EventListInterface
Overrides:
addAll in class RedBlackTree
Parameters:
collection - the collection
Returns:
true whenever the collection was sucessfully added.
See Also:
#addAll(java.util.Collection)

clear

public void clear()
Description copied from interface: EventListInterface
clears the eventlist by removing all its scheduled events.

Specified by:
clear in interface EventListInterface
Overrides:
clear in class RedBlackTree
See Also:
#clear()

remove

public boolean remove(SimEventInterface value)
Description copied from interface: EventListInterface
removes the event from this tree

Specified by:
remove in interface EventListInterface
Overrides:
remove in class RedBlackTree
Parameters:
value - the event to be removed
Returns:
true if the event was in the tree and succesfully removed.
See Also:
#remove(nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface)

removeAll

public boolean removeAll(Collection collection)
Description copied from interface: EventListInterface
removes a collection of events from this tree

Specified by:
removeAll in interface EventListInterface
Overrides:
removeAll in class RedBlackTree
Parameters:
collection - the colleciton
Returns:
true if the event was in the tree and succesfully removed.
See Also:
#removeAll(java.util.Collection)

removeFirst

public SimEventInterface removeFirst()
Description copied from interface: EventListInterface
removes the first event from the eventlist.

Specified by:
removeFirst in interface EventListInterface
Overrides:
removeFirst in class RedBlackTree
Returns:
the first event
See Also:
EventListInterface.removeFirst()

removeLast

public SimEventInterface removeLast()
Description copied from interface: EventListInterface
removes the last event from the eventlist.

Specified by:
removeLast in interface EventListInterface
Overrides:
removeLast in class RedBlackTree
Returns:
the last event
See Also:
EventListInterface.removeLast()


Copyright © 2002-2010 Delft University of Technology, the Netherlands. All Rights Reserved.