public class JSimQueue extends JComponent implements SimQueueListener
SimQueue.Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
JSimQueue(org.javades.jsimulation.r5.SimEventList eventList,
SimQueue queue) |
| Modifier and Type | Method and Description |
|---|---|
void |
notifyArrival(double t,
SimJob job,
SimQueue queue)
Notification of the arrival of a job at a queue.
|
void |
notifyAutoRevocation(double t,
SimJob job,
SimQueue queue)
Notification of the auto-revocation of a job at a queue.
|
void |
notifyDeparture(double t,
SimJob job,
SimQueue queue)
Notification of the departure of a job at a queue.
|
void |
notifyDrop(double t,
SimJob job,
SimQueue queue)
Notification of the drop of a job at a queue.
|
void |
notifyNewStartArmed(double t,
SimQueue queue,
boolean startArmed)
Notification of a change of a
SimQueue startArmed state. |
void |
notifyOutOfServerAccessCredits(double t,
SimQueue queue)
Notification that a
SimQueue has run out of server-access credits. |
protected void |
notifyQueueChanged(double t,
SimQueue queue) |
void |
notifyRegainedServerAccessCredits(double t,
SimQueue queue)
Notification that a
SimQueue has regained server-access credits. |
void |
notifyResetEntity(SimEntity entity)
Notification of a reset at a
SimEntity. |
void |
notifyRevocation(double t,
SimJob job,
SimQueue queue)
Notification of the (successful) revocation of a job at a queue.
|
void |
notifyStart(double t,
SimJob job,
SimQueue queue)
Notification of the start of a job at a queue.
|
void |
notifyStartQueueAccessVacation(double t,
SimQueue queue)
Notification of the start of a queue-access vacation.
|
void |
notifyStateChanged(double time,
SimEntity entity,
List notifications)
Notification of a (any) state change of a
SimEntity. |
void |
notifyStopQueueAccessVacation(double t,
SimQueue queue)
Notification of the end of a queue-access vacation.
|
void |
notifyUpdate(double t,
SimEntity entity)
Notification of an immediate upcoming update at an entity.
|
protected void |
paintComponent(Graphics g) |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic JSimQueue(org.javades.jsimulation.r5.SimEventList eventList,
SimQueue queue)
protected void paintComponent(Graphics g)
paintComponent in class JComponentprotected void notifyQueueChanged(double t,
SimQueue queue)
public void notifyStartQueueAccessVacation(double t,
SimQueue queue)
SimQueueListenernotifyStartQueueAccessVacation in interface SimQueueListenert - The (current) time.queue - The queue.SimQueue.setQueueAccessVacation(double, boolean)public void notifyStopQueueAccessVacation(double t,
SimQueue queue)
SimQueueListenernotifyStopQueueAccessVacation in interface SimQueueListenert - The (current) time.queue - The queue.SimQueue.setQueueAccessVacation(double, boolean)public void notifyOutOfServerAccessCredits(double t,
SimQueue queue)
SimQueueListenerSimQueue has run out of server-access credits.notifyOutOfServerAccessCredits in interface SimQueueListenert - The (current) time.queue - The queue.SimQueue.setServerAccessCredits(double, int)public void notifyRegainedServerAccessCredits(double t,
SimQueue queue)
SimQueueListenerSimQueue has regained server-access credits.notifyRegainedServerAccessCredits in interface SimQueueListenert - The (current) time.queue - The queue.public void notifyResetEntity(SimEntity entity)
SimEntityListenerSimEntity.
Convenience method as resets are also notified through SimEntityListener.notifyStateChanged(double, org.javades.jqueues.r5.entity.SimEntity, java.util.List<java.util.Map<org.javades.jqueues.r5.entity.SimEntitySimpleEventType.Member, org.javades.jqueues.r5.entity.SimEntityEvent>>).
notifyResetEntity in interface SimEntityListenerentity - The entity that has been reset.public void notifyUpdate(double t,
SimEntity entity)
SimEntityListenerAn update at an entity is defined as a moment in time at which the entity is about to change its state. The main advantage of an update notification is that you can inspect the entity right before it is about to change. This leads the way to (efficiently) maintaining time-based statistics on the entity.
The general contract is that in between entity notifications, the entity does not change its state. However, what exactly comprises the state of the entity has to be documented by concrete implementations.
Update notifications through SimEntityListener.notifyUpdate(double, org.javades.jqueues.r5.entity.SimEntity)
and state-change notifications through SimEntityListener.notifyStateChanged(double, org.javades.jqueues.r5.entity.SimEntity, java.util.List<java.util.Map<org.javades.jqueues.r5.entity.SimEntitySimpleEventType.Member, org.javades.jqueues.r5.entity.SimEntityEvent>>) are dual in the sense that
the former are issued before and the latter after
a state change.
Preferably, update and state-change notifications for a single entity must always alternate. However, the only requirement in that sense is that a state-change notification must be immediately preceded with an update notification with equal time. It is therefore allowed to issue multiple update-notifications in between two consecutive state-change notifications, as long as the last update notification has the same time-stamp as the the second state-change notification.
Both types of notifications should not be sent upon construction of the entity;
there are no SimEntityListeners at this stage anyway.
However, upon an explicit reset of a SimEntity,
it is recommended to issue a SimEntityListener.notifyUpdate(double, org.javades.jqueues.r5.entity.SimEntity) before applying the reset.
Listeners must never directly or indirectly cause state changes on the reporting entity.
See SimEntity.doAfterNotifications(org.javades.jqueues.r5.entity.SimEntity.Action) for a workaround.
Beware that updates are never reported as state-change event.
notifyUpdate in interface SimEntityListenert - The time of the update.entity - The entity that is about to be updated.SimEntityListener.notifyStateChanged(double, org.javades.jqueues.r5.entity.SimEntity, java.util.List<java.util.Map<org.javades.jqueues.r5.entity.SimEntitySimpleEventType.Member, org.javades.jqueues.r5.entity.SimEntityEvent>>),
AbstractSimQueueStatpublic void notifyStateChanged(double time,
SimEntity entity,
List notifications)
SimEntityListenerSimEntity.
All state changes of a SimEntity must be reported through this method.
The notification is passed as a list of (SimEntitySimpleEventType.Member, SimEntityEvent) tuples,
the sub-notifications.
Note that the maps must have exactly one non-null key with non-null value.
All sub-notifications must have time set identical to the time passed as argument.
These sub-notifications form the sequence of (sub-)events describing the atomic state-change as a whole.
Beware that updates are never reported as state-change event.
notifyStateChanged in interface SimEntityListenertime - The current time (the time of the state change).entity - The entity at which the state changed.notifications - The sequence of notifications of state-changes the combination of which led to the new state.SimEntityListener.notifyUpdate(double, org.javades.jqueues.r5.entity.SimEntity)public void notifyArrival(double t,
SimJob job,
SimQueue queue)
SimJQListenernotifyArrival in interface SimJQListenert - The (current) time.job - The job.queue - The queue.SimQueue.arrive(double, J)public void notifyStart(double t,
SimJob job,
SimQueue queue)
SimJQListenernotifyStart in interface SimJQListenert - The (current) time.job - The job.queue - The queue.public void notifyDrop(double t,
SimJob job,
SimQueue queue)
SimJQListenernotifyDrop in interface SimJQListenert - The (current) time.job - The job.queue - The queue.public void notifyRevocation(double t,
SimJob job,
SimQueue queue)
SimJQListenernotifyRevocation in interface SimJQListenert - The (current) time.job - The job.queue - The queue.SimQueue.revoke(double, J, boolean)public void notifyAutoRevocation(double t,
SimJob job,
SimQueue queue)
SimJQListenernotifyAutoRevocation in interface SimJQListenert - The (current) time.job - The job.queue - The queue.SimQueue.getAutoRevocationPolicy()public void notifyDeparture(double t,
SimJob job,
SimQueue queue)
SimJQListenernotifyDeparture in interface SimJQListenert - The (current) time.job - The job.queue - The queue.public void notifyNewStartArmed(double t,
SimQueue queue,
boolean startArmed)
SimQueueListenerSimQueue startArmed state.notifyNewStartArmed in interface SimQueueListenert - The (current) time.queue - The queue.startArmed - The new startArmed state.SimQueue.isStartArmed()Copyright © 2018. All rights reserved.