public final class SimQueueVisitsCounterStateHandler extends Object implements SimQueueStateHandler
SimQueueStateHandler for counting per-job visits to a SimQueue.Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
SimQueuePredictor_FB_v,
SimQueuePredictor_Pattern| Constructor and Description |
|---|
SimQueueVisitsCounterStateHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsJob(SimJob job)
Checks whether the given job has visited the queue at least once.
|
String |
getHandlerName()
Returns "SimQueueVisitsCounterStateHandler".
|
int |
getNumberOfVisitsForJob(SimJob job)
Gets the number of visits recorded for the given job.
|
int |
getTotalNumberOfVisits() |
void |
incNumberOfVisitsForJob(SimJob job)
Increments the number of visits to the queue of the given job.
|
void |
incTotalNumberOfVisits() |
void |
initHandler(DefaultSimQueueState queueState)
Initializes the handler, and passes the
DefaultSimQueueState object. |
void |
newJob(SimJob job)
Adds a first-time visiting job, and sets its number of visits to unity.
|
void |
removeJob(SimJob job)
Removes the given job from the internal queue-visits administration, but insists it is known.
|
void |
resetHandler(DefaultSimQueueState queueState)
Resets the (state represented by) this handler.
|
void |
resetTotalNumberOfVisits() |
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 final int getTotalNumberOfVisits()
public final void incTotalNumberOfVisits()
public final void resetTotalNumberOfVisits()
public final int getNumberOfVisitsForJob(SimJob job)
job - The job, non-null.IllegalArgumentException - If the job is null or if the job has not visited the queue (yet).public final boolean containsJob(SimJob job)
job - The job, non-null.true if the given job has visited the queue at least once.IllegalArgumentException - If the job is null.public final void newJob(SimJob job)
job - The job, non-null.IllegalArgumentException - If the job is null or if the job has already visited the queue before.public final void incNumberOfVisitsForJob(SimJob job)
job - The job, non-null.IllegalArgumentException - If the job is null or if the job has not visited the queue (yet).public final void removeJob(SimJob job)
job - The job, non-null.IllegalArgumentException - If the job is null or if the job has not visited the queue (yet).Copyright © 2018. All rights reserved.