public final class SimQueueWithGateStateHandler extends Object implements SimQueueStateHandler
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
| Constructor and Description |
|---|
SimQueueWithGateStateHandler() |
| Modifier and Type | Method and Description |
|---|---|
int |
getGatePassageCredits()
Gets the remaining number of passage credits for the gate.
|
String |
getHandlerName()
Returns "SimQueueWithGateHandler".
|
void |
initHandler(DefaultSimQueueState queueState)
Initializes the handler, and passes the
DefaultSimQueueState object. |
void |
resetHandler(DefaultSimQueueState queueState)
Resets the (state represented by) this handler.
|
void |
setGatePassageCredits(double time,
int gatePassageCredits)
Sets the remaining number of passage credits for the gate.
|
public final String getHandlerName()
getHandlerName in interface SimQueueStateHandlerpublic final void initHandler(DefaultSimQueueState queueState)
SimQueueStateHandlerDefaultSimQueueState object.
This method is called only once during registration at the DefaultSimQueueState object.
initHandler in interface SimQueueStateHandlerqueueState - The DefaultSimQueueState at which we register, non-null.DefaultSimQueueState.registerHandler(org.javades.jqueues.r5.util.predictor.state.SimQueueStateHandler)public void resetHandler(DefaultSimQueueState queueState)
SimQueueStateHandlerresetHandler in interface SimQueueStateHandlerqueueState - The DefaultSimQueueState at which we are registered, non-null.SimQueueState.reset(),
DefaultSimQueueState.reset()public int getGatePassageCredits()
Integer.MAX_VALUE treated as infinity.IllegalStateException - If we are not registered at a DefaultSimQueueState.public void setGatePassageCredits(double time,
int gatePassageCredits)
Mimics SimQueueWithGate.getGatePassageCredits().
The time cannot be in the past.
time - The time to set the remaining number of passages.gatePassageCredits - The new remaining number of passage credits for the gate, non-negative,
with Integer.MAX_VALUE treated as infinity.IllegalStateException - If we are not registered at a DefaultSimQueueState.IllegalArgumentException - If time is in the past, or the number of passage credits is (strictly) negative.DefaultSimQueueState.setTime(double)Copyright © 2018. All rights reserved.