Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nl.tudelft.simulation.dsol.eventlists
Interface EventListInterface

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  RedBlackTree

public interface EventListInterface
extends java.io.Serializable

The EventListInterface defines the required methods for discrete event lists. A number of competitive algoritms can be used to implement such eventlist. Among these implementations are the Red-Black, the SplayTree, and others.

(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Since:
  1.0
Version:
  1.7 2004-03-28
Author:
  Peter Jacobs

Method Summary
`boolean` | `add(SimEventInterface event)` adds an event to the eventlist
`boolean` | `addAll(java.util.Collection collection)` adds a collection of events to the tree
`void` | `clear()` clears the eventlist by removing all its scheduled events.
`boolean` | `contains(SimEventInterface event)` returns whether event is an entry of the eventlist
`boolean` | `containsAll(java.util.Collection collection)` returns whether the collection is in the list.
`SimEventInterface` | `first()` returns the first scheduled event
`boolean` | `isEmpty()` returns whether the eventlist is empty
`java.util.Iterator` | `iterator()` returns the iterator for this eventlist
`SimEventInterface` | `last()` returns the last scheduled event
`boolean` | `remove(SimEventInterface event)` removes the event from this tree
`boolean` | `removeAll(java.util.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.
`int` | `size()` returns the number of scheduled events
`SimEventInterface[]` | `toArray()` returns the eventlist as array of simevents

Method Detail

### add

    public boolean add(SimEventInterface event)

  adds an event to the eventlist

  Parameters:
    `event` - the event to add
  Returns:
    true whenever the event was not already scheduled.

### addAll

    public boolean addAll(java.util.Collection collection)

  adds a collection of events to the tree

  Parameters:
    `collection` - the collection
  Returns:
    true whenever the collection was sucessfully added.

### clear

    public void clear()

  clears the eventlist by removing all its scheduled events.

### contains

    public boolean contains(SimEventInterface event)

  returns whether event is an entry of the eventlist

  Parameters:
    `event` - the event
  Returns:
    true if event in tree; otherwise false.

### containsAll

    public boolean containsAll(java.util.Collection collection)

  returns whether the collection is in the list.

  Parameters:
    `collection` - the collection to test
  Returns:
    true if event in tree; otherwise false.

### first

    public SimEventInterface first()

  returns the first scheduled event

  Returns:
    first scheduled event.

### isEmpty

    public boolean isEmpty()

  returns whether the eventlist is empty

  Returns:
    true if empty.

### iterator

    public java.util.Iterator iterator()

  returns the iterator for this eventlist

  Returns:
    the iterator

### last

    public SimEventInterface last()

  returns the last scheduled event

  Returns:
    last scheduled event.

### remove

    public boolean remove(SimEventInterface event)

  removes the event from this tree

  Parameters:
    `event` - the event to be removed
  Returns:
    true if the event was in the tree and succesfully removed.

### removeAll

    public boolean removeAll(java.util.Collection collection)

  removes a collection of events from this tree

  Parameters:
    `collection` - the colleciton
  Returns:
    true if the event was in the tree and succesfully removed.

### removeFirst

    public SimEventInterface removeFirst()

  removes the first event from the eventlist.

  Returns:
    the first event

### removeLast

    public SimEventInterface removeLast()

  removes the last event from the eventlist.

  Returns:
    the last event

### size

    public int size()

  returns the number of scheduled events

  Returns:
    the number of scheduled events.

### toArray

    public SimEventInterface[] toArray()

  returns the eventlist as array of simevents

  Returns:
    the eventlist as array of simevents.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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