Package nl.tudelft.simulation.examples.dsol.terminal

# Class Ship

java.lang.Object
org.djutils.event.EventProducer
nl.tudelft.simulation.examples.dsol.terminal.Ship

All Implemented Interfaces:
  `Serializable`, `org.djutils.event.EventProducerInterface`

    public class Ship
    extends org.djutils.event.EventProducer

Copyright (c) 2002-2020 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://simulation.tudelft.nl/dsol/3.0/license.html.

Author:
  Peter Jacobs, Alexander Verbraeck
See Also:
  Serialized Form

## Field Summary

Fields
Modifier and Type | Field | Description
--- | --- | ---
`static org.djutils.event.EventType` | `SHIP_FULL_EVENT` | the ship-full event.

### Fields inherited from class org.djutils.event.EventProducer

`eventProducerImpl`

### Fields inherited from interface org.djutils.event.EventProducerInterface

`FIRST_POSITION, LAST_POSITION`

## Constructor Summary

Constructors
Constructor | Description
--- | ---
`Ship​(int capacity)` |

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`int` | `getContainers()` |
`Serializable` | `getSourceId()`
`void` | `incContainers()` | increase the number of containers and fire an event when full.

### Methods inherited from class org.djutils.event.EventProducer

`addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SHIP_FULL_EVENT

public static final org.djutils.event.EventType SHIP_FULL_EVENT
the ship-full event.

## Constructor Details

### Ship

public Ship​(int capacity)

Parameters:
  `capacity` - int; the ship's capacity

## Method Details

### incContainers

public void incContainers()
increase the number of containers and fire an event when full.

### getContainers

public final int getContainers()

Returns:
  containers

### getSourceId

public Serializable getSourceId()

Specified by:
  `getSourceId` in interface `org.djutils.event.EventProducerInterface`
Specified by:
  `getSourceId` in class `org.djutils.event.EventProducer`