Class ValueCopy
- java.lang.Object
-
- net.ssehub.easy.varModel.model.rewrite.ValueCopy
-
- All Implemented Interfaces:
IValueVisitor
class ValueCopy extends java.lang.Object implements IValueVisitor
Filters a givenValueand creates a copy without filtered elements.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private RewriteContextcontextprivate ValuecopiedValueStores the current visited value.private booleanvaluesOmmited
-
Constructor Summary
Constructors Constructor Description ValueCopy(RewriteContext context, Value value)Single constructor of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ValuegetValue()Returns the filtered and copied value.(package private) booleanvaluesOmitted()Returns whether the original value will be returned or whether at least one value was removed from the original value.voidvisitBooleanValue(BooleanValue value)This method is used for visiting BooleanValue.voidvisitCompoundValue(CompoundValue value)This method is used for visiting CompoundValue.voidvisitConstraintValue(ConstraintValue value)This method is used for visiting ConstraintValue.voidvisitContainerValue(ContainerValue value)This method is used for visiting ContainerValue.voidvisitEnumValue(EnumValue value)This method is used for visiting EnumValue.voidvisitIntValue(IntValue value)This method is used for visiting IntValue.voidvisitMetaTypeValue(MetaTypeValue value)This method is used for visiting meta type value.voidvisitNullValue(NullValue value)This method is used for visiting a null value.voidvisitRealValue(RealValue value)This method is used for visiting RealValue.voidvisitReferenceValue(ReferenceValue referenceValue)This method is used for visiting referenceValue.voidvisitStringValue(StringValue value)This method is used for visiting StringValue.voidvisitVersionValue(VersionValue value)This method is used for visiting a version value.
-
-
-
Field Detail
-
copiedValue
private Value copiedValue
Stores the current visited value. Maybe the same instance or a copied/filtered version. Maybe null if the current value shall be filtered out.
-
valuesOmmited
private boolean valuesOmmited
-
context
private RewriteContext context
-
-
Constructor Detail
-
ValueCopy
ValueCopy(RewriteContext context, Value value)
Single constructor of this class.- Parameters:
context- The context, containing information about filtered elements.value- The value to be copied.
-
-
Method Detail
-
getValue
Value getValue()
Returns the filtered and copied value.- Returns:
- Maybe the same instance if filtering was not needed. Maybe null if complete value was filtered.
-
valuesOmitted
boolean valuesOmitted()
Returns whether the original value will be returned or whether at least one value was removed from the original value.- Returns:
- true if at least one value was removed, false if the original value will be returned.
-
visitConstraintValue
public void visitConstraintValue(ConstraintValue value)
Description copied from interface:IValueVisitorThis method is used for visiting ConstraintValue.- Specified by:
visitConstraintValuein interfaceIValueVisitor- Parameters:
value- One ConstraintValue which should be visited.
-
visitEnumValue
public void visitEnumValue(EnumValue value)
Description copied from interface:IValueVisitorThis method is used for visiting EnumValue.- Specified by:
visitEnumValuein interfaceIValueVisitor- Parameters:
value- One EnumValue which should be visited.
-
visitStringValue
public void visitStringValue(StringValue value)
Description copied from interface:IValueVisitorThis method is used for visiting StringValue.- Specified by:
visitStringValuein interfaceIValueVisitor- Parameters:
value- One StringValue which should be visited.
-
visitCompoundValue
public void visitCompoundValue(CompoundValue value)
Description copied from interface:IValueVisitorThis method is used for visiting CompoundValue.- Specified by:
visitCompoundValuein interfaceIValueVisitor- Parameters:
value- One CompoundValue which should be visited.
-
visitContainerValue
public void visitContainerValue(ContainerValue value)
Description copied from interface:IValueVisitorThis method is used for visiting ContainerValue.- Specified by:
visitContainerValuein interfaceIValueVisitor- Parameters:
value- One CompoundValue which should be visited.
-
visitIntValue
public void visitIntValue(IntValue value)
Description copied from interface:IValueVisitorThis method is used for visiting IntValue.- Specified by:
visitIntValuein interfaceIValueVisitor- Parameters:
value- One IntValue which should be visited.
-
visitRealValue
public void visitRealValue(RealValue value)
Description copied from interface:IValueVisitorThis method is used for visiting RealValue.- Specified by:
visitRealValuein interfaceIValueVisitor- Parameters:
value- One RealValue which should be visited.
-
visitBooleanValue
public void visitBooleanValue(BooleanValue value)
Description copied from interface:IValueVisitorThis method is used for visiting BooleanValue.- Specified by:
visitBooleanValuein interfaceIValueVisitor- Parameters:
value- One BooleanValue which should be visited.
-
visitReferenceValue
public void visitReferenceValue(ReferenceValue referenceValue)
Description copied from interface:IValueVisitorThis method is used for visiting referenceValue.- Specified by:
visitReferenceValuein interfaceIValueVisitor- Parameters:
referenceValue- One referenceValue which should be visited.
-
visitMetaTypeValue
public void visitMetaTypeValue(MetaTypeValue value)
Description copied from interface:IValueVisitorThis method is used for visiting meta type value.- Specified by:
visitMetaTypeValuein interfaceIValueVisitor- Parameters:
value- a value which should be visited.
-
visitNullValue
public void visitNullValue(NullValue value)
Description copied from interface:IValueVisitorThis method is used for visiting a null value.- Specified by:
visitNullValuein interfaceIValueVisitor- Parameters:
value- a value which should be visited (actuallyNullValue.INSTANCE).
-
visitVersionValue
public void visitVersionValue(VersionValue value)
Description copied from interface:IValueVisitorThis method is used for visiting a version value.- Specified by:
visitVersionValuein interfaceIValueVisitor- Parameters:
value- a value which should be visited.
-
-