public class QueueSynchronized extends Xholon implements IQueue
DEFAULT_SIZE_MSG_Q, DEFAULT_SIZE_SYSTEM_MSG_Q, GETNAME_DEFAULT, GETNAME_LOCALPART_ID, GETNAME_NOROLENAME, GETNAME_ROLENAME_OR_CLASSNAME, GETNAME_ROLENAMESEP_, GETNAME_SIZE_TEMPLATE, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx, XHOLON_ID_DEFAULT, XHOLON_ID_NULL
Constructor and Description |
---|
QueueSynchronized(int numItems)
Use this constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
dequeue()
Take an object off the queue.
|
void |
doAction(java.lang.String action)
Do a specific action that this xholon knows how to do.
|
void |
empty()
Empty the Queue, and discard its contents.
|
int |
enqueue(java.lang.Object p_item)
Add an object to the queue.
|
java.lang.String[] |
getActionList()
Get a list of actions that this xholon can do.
|
java.util.Vector |
getItems()
Get the internal item array.
|
int |
getMaxSize()
Get maximum number of items that can be in the queue.
|
int |
getSize()
Get number of items currently in the queue.
|
java.lang.Object |
getVal_Object()
Get the value of a "Object" maintained by this xholon instance.
|
void |
sendMessage(int signal,
java.lang.Object data,
IXholon sender)
Send a message to a receiving Xholon instance.
|
void |
setMaxSize(int maxSize)
Set the maximum number of items that can be in the queue,
and allocate space for that many items.
|
void |
setVal_Object(java.lang.Object obj)
Set the value of a "Object" maintained by this xholon instance.
|
void |
shuffle()
Randomize the order of the items in the queue.
|
void |
sort()
Sort the items in the queue.
|
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, compareTo, configure, configure, consoleLog, decVal, decVal, depth, equals, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFactory, getFirstChild, getFirstSibling, getId, getInteraction, getInteractionsEnabled, getIQueueImplName, getLastChild, getLastSibling, getLogger, getMsgQ, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getSystemMsgQ, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, getXPath, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, searchForReferencingNodesRecurse, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toString, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
getClass, hashCode, notify, notifyAll, wait, wait, wait
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, configure, configure, consoleLog, decVal, decVal, depth, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
public QueueSynchronized(int numItems)
numItems
- Maximum number of items that can be in the queue.public int enqueue(java.lang.Object p_item)
IQueue
public java.lang.Object dequeue()
IQueue
public int getSize()
IQueue
public int getMaxSize()
IQueue
getMaxSize
in interface IQueue
public void setMaxSize(int maxSize)
IQueue
setMaxSize
in interface IQueue
maxSize
- Maximum queue size.public void shuffle()
IQueue
public void sort()
IQueue
public void empty()
IQueue
public java.lang.String[] getActionList()
IXholon
getActionList
in interface IXholon
getActionList
in class Xholon
public void doAction(java.lang.String action)
IXholon
public void sendMessage(int signal, java.lang.Object data, IXholon sender)
IXholon
sendMessage
in interface IXholon
sendMessage
in class Xholon
signal
- A distinguishing identifier for this message.data
- Any data that needs to be sent (optional).sender
- The sender of the message.public java.util.Vector getItems()
IQueue
public java.lang.Object getVal_Object()
IXholon
getVal_Object
in interface IXholon
getVal_Object
in class Xholon
public void setVal_Object(java.lang.Object obj)
IXholon
setVal_Object
in interface IXholon
setVal_Object
in class Xholon