public class VariableAssignment extends java.util.Observable implements PropertyBarEntry, PropertyDrawEntry
| Modifier and Type | Field and Description |
|---|---|
private AbstractVariableDefinition |
definition
Represents the type of the variable.
|
private java.lang.String |
nameOfAssignment
Represents the name of the variable.
|
private Position |
position
Position where the entry is written.
|
private java.lang.String |
value
Represents value of the variable.
|
| Constructor and Description |
|---|
VariableAssignment(java.lang.String nameOfAssignment,
AbstractVariableDefinition definition,
java.lang.String value,
Position position)
Constructor, just sets the fields.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(CompareVaNameVisitor visitor)
Accept methode for the CompareVaNameVisitor.
|
java.awt.Component |
accept(DetailBarVisitor visitor)
Accept methode for the DetaibarVisitor.
|
void |
accept(DetailDrawVisitor visitor)
Accept methode for the DetaibarVisitor.
|
java.lang.String |
accept(ItemGetNameVisitor visitor)
Accept methode for the ItemGetNameVisitor.
|
void |
accept(ItemSetNameVisitor visitor)
Accept methode for the ItemSetNameVisitor.
|
boolean |
checkValue(java.lang.String valueToCheck)
Checks if an value is the range of a type regex.
|
boolean |
equals(java.lang.Object obj) |
AbstractVariableDefinition |
getDefinition()
Returns the field definition.
|
java.lang.String |
getNameOfAssignment()
Returns the field name.
|
Position |
getPosition()
Returns the field row.
|
java.lang.String |
getValue()
Returns the field value.
|
int |
hashCode() |
java.lang.String |
print()
Returns the line to print.
|
void |
setValue(java.lang.String value)
Try to set a new value to the variable (field).
|
private java.lang.String value
private final AbstractVariableDefinition definition
private final java.lang.String nameOfAssignment
private final Position position
public VariableAssignment(java.lang.String nameOfAssignment,
AbstractVariableDefinition definition,
java.lang.String value,
Position position)
definition - VariableDefinition to set (field)value - Value to set (field)nameOfAssignment - The name to set.position - The position to set.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void setValue(java.lang.String value)
throws ValueNotInRangeOfTypeException,
java.lang.IllegalArgumentException,
TypeDoesNotExistException,
TypeExceptions
value - The value to set.ValueNotInRangeOfTypeException - The value is not in the range of the given type.java.lang.IllegalArgumentException - see java.lang.IllegalArgumentException.TypeExceptions - The TypeExceptions.TypeDoesNotExistException - The TypeDoesNotExistException.CycleInHierarchyDetectedException - The CycleInHierarchyDetectedException.public Position getPosition()
public java.lang.String getValue()
public AbstractVariableDefinition getDefinition()
public boolean checkValue(java.lang.String valueToCheck)
throws java.lang.IllegalArgumentException,
ReferenceIsUnresolvedException
valueToCheck - the value to check if it matches the regular expressionjava.lang.IllegalArgumentExceptionReferenceIsUnresolvedException - is thrown if a part of the RegEx is unresolvedjava.lang.IllegalArgumentException - see java.lang.IllegalArgumentExceptionCycleInHierarchyDetectedExceptionpublic java.lang.String getNameOfAssignment()
public java.lang.String print()
public java.awt.Component accept(DetailBarVisitor visitor)
PropertyBarEntryaccept in interface PropertyBarEntryvisitor - the visitorpublic void accept(DetailDrawVisitor visitor)
PropertyDrawEntryaccept in interface PropertyDrawEntryvisitor - the visitorpublic boolean accept(CompareVaNameVisitor visitor)
PropertyBarEntryaccept in interface PropertyBarEntryvisitor - the visitorpublic java.lang.String accept(ItemGetNameVisitor visitor)
PropertyBarEntryaccept in interface PropertyBarEntryvisitor - the visitorpublic void accept(ItemSetNameVisitor visitor) throws java.lang.IllegalArgumentException, ValueNotInRangeOfTypeException, TypeDoesNotExistException, TypeExceptions
PropertyBarEntryaccept in interface PropertyBarEntryvisitor - the visitorjava.lang.IllegalArgumentException - see java.lang.IllegalArgumentException.ValueNotInRangeOfTypeException - The value is not in the range of the given type.TypeDoesNotExistException - The TypeDoesNotExistException.TypeExceptions - The TypeExceptions.