public class Sense extends NamedLapElement implements Comparable<Sense>
| Modifier and Type | Class and Description |
|---|---|
static class |
Sense.Predicate
Various predicates used in Sense
|
| Modifier and Type | Field and Description |
|---|---|
static DataFlavor |
dataFlavor |
static String |
psArgs |
static String |
psPredicateIndex |
static String |
psSenseName |
static String |
psType |
static String |
psValue |
IDENT_PATTERN| Constructor and Description |
|---|
Sense(PrimitiveCall senseCall)
Create sense that will evaluate based on result of called primitive
some parameters
|
Sense(PrimitiveCall senseCall,
Object operand,
Sense.Predicate predicate) |
Sense(String senseName)
Create sense that will evaluate true based on result of called primitive.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeTo(Sense other)
Take other sense and change all attributes in the sense to be same
as in other sense.
|
int |
compareTo(Sense o) |
List<PoshElement> |
getChildDataNodes()
Get list of children of this node.
|
DataFlavor |
getDataFlavor()
Get data flavour of posh plan element,used during DnD from palette to
PoshScene.
|
String |
getName()
Get name of the element.
|
Object |
getOperand()
Get operand that should be used for evaluating this sense.
|
Sense.Predicate |
getPredicate() |
Integer |
getPredicateIndex() |
String |
getRepresentation()
Get human readable representation of this sense.
|
String |
getRepresentation(String name)
Get string representation of the sense, i.e.
|
PrimitiveCall |
getSenseCall()
Get param
|
String |
getSenseName() |
Trigger<?> |
getTrigger()
Get
Trigger this sense is part of. |
String |
getValueString()
Used in Node.Properties
XXX: Do more properly with custom editor
|
boolean |
moveChild(int newIndex,
PoshElement child)
Move child to the @newIndex.
|
void |
parseSense(String input)
TODO: Correctly document, changed in hurry.
|
void |
removeFromParent()
This is a common method for removing the sense from its parent.
|
void |
setArguments(Arguments newArguments) |
void |
setOperand(Object newValue)
Set value of argument (as class, e.g.
|
void |
setPredicate(Sense.Predicate newPredicate)
Set the predicate in the sense.
|
void |
setPredicateIndex(Integer newPredicateIndex)
Set predicate, use index to array Predicate.values()[index]
|
void |
setSenseName(String newSenseName)
Set new sense name if new name matches IDENT_PATTERN, name will be trimmed.
|
String |
toString()
Return text representation in posh friendly manner.
|
getUnusedName, isUsedName, moveChildInListaddElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getElementListeners, getNumberOfChildInstances, getParent, getRootNode, isChildOfParent, removeElementListener, setParentpublic static final String psSenseName
public static final String psArgs
public static final String psPredicateIndex
public static final String psValue
public static final String psType
public static final DataFlavor dataFlavor
public Sense(String senseName)
senseName - name of primitivepublic Sense(PrimitiveCall senseCall)
senseCall - details of call primitivepublic Sense(PrimitiveCall senseCall, Object operand, Sense.Predicate predicate)
senseCall - operand - operand that will be parsed and changed into proper objectpredicate - public String getSenseName()
public PrimitiveCall getSenseCall()
public void setSenseName(String newSenseName) throws InvalidNameException
newSenseName - InvalidNameExceptionpublic String getValueString()
public Object getOperand()
public void setOperand(Object newValue)
newValue - number, string or nilpublic Integer getPredicateIndex()
public Sense.Predicate getPredicate()
public void setPredicate(Sense.Predicate newPredicate)
newPredicate - non nullpublic void setPredicateIndex(Integer newPredicateIndex)
newPredicateIndex - index to new predicatepublic void setArguments(Arguments newArguments)
public void parseSense(String input) throws ParseException
input - InvalidNameException - When name of the sense is not valid.InvalidFormatException - When wrong number of tokens in the input.ParseExceptionpublic void changeTo(Sense other) throws InvalidNameException
other - InvalidNameExceptionpublic String toString()
public String getName()
NamedLapElementgetName in class NamedLapElementpublic List<PoshElement> getChildDataNodes()
PoshElementgetChildDataNodes in class PoshElementpublic boolean moveChild(int newIndex,
PoshElement child)
PoshElementmoveChild in class PoshElementpublic DataFlavor getDataFlavor()
PoshElementgetDataFlavor in class PoshElementpublic String getRepresentation()
public String getRepresentation(String name)
name - Name that is used instead of name in the PrimitiveCallpublic int compareTo(Sense o)
compareTo in interface Comparable<Sense>public Trigger<?> getTrigger()
Trigger this sense is part of. Trigger by itself is
not a PoshElement, but it is part of some other element (e.g. DriveCollection
or CompetenceElement)IllegalArgumentException - If parent is null or I forgot some
possible parent.public void removeFromParent()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.