public class Quantity extends Xholon implements IQuantity
<Length>10.0 m</Length> is a scalar <Length>10.0 20.0 m</Length> is a vector
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 |
---|
Quantity() |
Modifier and Type | Method and Description |
---|---|
void |
decVal(double val)
Decrement an internal double value by a specified amount.
|
java.lang.String |
getDimension()
Get Dimension.
|
java.lang.Object |
getInstance() |
java.lang.String |
getRoleName()
Get name of the role played by this Xholon within a specific context.
|
java.lang.String |
getStandardUnit()
Get Standard Unit.
|
java.lang.String |
getUnit()
Get Unit.
|
int |
getVal_int()
Get the value of a "int" maintained by this xholon instance.
|
long |
getVal_long()
Get the value of a "long" maintained by this xholon instance.
|
java.lang.Object |
getVal_Object()
Get the value of a "Object" maintained by this xholon instance.
|
java.lang.String |
getVal_String()
Get the value of a "String" maintained by this xholon instance.
|
double |
getVal()
Get the value of a "double" maintained by this xholon instance.
|
double |
getValueN(int index)
Get a specified value from the array of magnitudes for this scalar or vector.
|
double[] |
getValues()
Get the array of magnitudes for this scalar or vector.
|
void |
incVal(double val)
Increment an internal double value by a specified amount.
|
void |
postConfigure()
Perform some action, typically once at start up; MAY be overridden.
|
void |
setRoleName(java.lang.String roleName)
Set name of the role played by this Xholon within a specific context.
|
void |
setVal(double val)
Set the value of a "double" maintained by this xholon instance.
|
void |
setVal(int val)
Set the value of a "int" maintained by this xholon instance.
|
void |
setVal(long val)
Set the value of a "long" maintained by this xholon instance.
|
void |
setVal(java.lang.Object val)
Set the value of a "Object" maintained by this xholon instance.
|
void |
setVal(java.lang.String val)
Set the value of a "String" maintained by this xholon instance.
|
java.lang.String |
toString() |
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, compareTo, configure, configure, consoleLog, decVal, depth, doAction, equals, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getActionList, 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, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getSystemMsgQ, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_short, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, getXPath, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, 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, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, searchForReferencingNodesRecurse, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
public void postConfigure()
IXholon
postConfigure
in interface IXholon
postConfigure
in class Xholon
public java.lang.Object getVal_Object()
IXholon
getVal_Object
in interface IXholon
getVal_Object
in class Xholon
public void setVal(java.lang.Object val)
IXholon
public java.lang.String getVal_String()
IXholon
getVal_String
in interface IXholon
getVal_String
in class Xholon
public void setVal(java.lang.String val)
IXholon
public double getVal()
IXholon
public void setVal(double val)
IXholon
public void incVal(double val)
IXholon
public void decVal(double val)
IXholon
public long getVal_long()
IXholon
getVal_long
in interface IXholon
getVal_long
in class Xholon
public void setVal(long val)
IXholon
public int getVal_int()
IXholon
getVal_int
in interface IXholon
getVal_int
in class Xholon
public void setVal(int val)
IXholon
public java.lang.String getUnit()
IQuantity
public java.lang.String getStandardUnit()
IQuantity
getStandardUnit
in interface IQuantity
public java.lang.String getDimension()
IQuantity
getDimension
in interface IQuantity
public double[] getValues()
IQuantity
getValues
in interface IQuantity
public double getValueN(int index)
IQuantity
getValueN
in interface IQuantity
index
- The index of the requested magnitude.
Index must be >= 0, and < the dimension of the vector.
For a scalar or 1D vector, index is assumed to be == 0 and is not checked.
For a 2D vector, 0 <= index < 2 .public java.lang.String getRoleName()
IXholon
getRoleName
in interface IXholon
getRoleName
in class Xholon
public void setRoleName(java.lang.String roleName)
IXholon
setRoleName
in interface IXholon
setRoleName
in class Xholon
roleName
- An optional name that identifies the role.public java.lang.Object getInstance()