Class TableModelEventList<T extends Number & Comparable<T>>
java.lang.Object
nl.tudelft.simulation.dsol.eventlists.RedBlackTree<T>
nl.tudelft.simulation.dsol.eventlists.TableModelEventList<T>
- Type Parameters:
T
- the type of simulation time, e.g. SimTimeCalendarLong or Double or DoubleUnit.
- All Implemented Interfaces:
Serializable
,Iterable<SimEventInterface<T>>
,EventListInterface<T>
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.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Since:
- 1.5
- Author:
- Peter Jacobs
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.djutils.event.EventType
The EVENTLIST_CHANGED_EVENT.static final String[]
The tableHeader. -
Constructor Summary
ConstructorDescriptionTableModelEventList
(EventListInterface<T> origin) constructs a new TableModelEventList. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(Collection<? extends SimEventInterface<T>> collection) Add all events in the collection to the ventlist.void
clear()
Clear the event list.returns the tableModel.Returns and removes the first event (lowest time / priority) of the event list.void
setShowPackage
(boolean showPackage) sets the showPackage.Methods inherited from class nl.tudelft.simulation.dsol.eventlists.RedBlackTree
add, contains, first, isEmpty, iterator, remove, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EVENTLIST_CHANCED_EVENT
public static final org.djutils.event.EventType EVENTLIST_CHANCED_EVENTThe EVENTLIST_CHANGED_EVENT. -
HEADER
The tableHeader.
-
-
Constructor Details
-
TableModelEventList
constructs a new TableModelEventList.- Parameters:
origin
- EventListInterface<T>; the origin
-
-
Method Details
-
getTableModel
returns the tableModel.- Returns:
- TableModel result
-
setShowPackage
public void setShowPackage(boolean showPackage) sets the showPackage.- Parameters:
showPackage
- boolean; The showPackage to set.
-
addAll
Add all events in the collection to the ventlist.- Parameters:
collection
- events
-
clear
public void clear()Clear the event list.- Specified by:
clear
in interfaceEventListInterface<T extends Number & Comparable<T>>
- Overrides:
clear
in classRedBlackTree<T extends Number & Comparable<T>>
-
removeFirst
Returns and removes the first event (lowest time / priority) of the event list. The method returns null when the event list is empty.- Specified by:
removeFirst
in interfaceEventListInterface<T extends Number & Comparable<T>>
- Overrides:
removeFirst
in classRedBlackTree<T extends Number & Comparable<T>>
- Returns:
- SimEventInterface<T>; the first element in this event list before removal, or null when the list is empty
-