Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package eu.mihosoft.vmf.vmftext.grammar.impl;
// vmf imports
//import eu.mihosoft.vmf.runtime.core.*;
//import eu.mihosoft.vmf.runtime.core.internal.*;
import eu.mihosoft.vcollections.*;
import eu.mihosoft.vmf.vmftext.grammar.*;
import java.beans.PropertyChangeListener;
// property types imports
import eu.mihosoft.vcollections.*;
// interface
/**
* An read-only representation of the model object {@code eu.mihosoft.vmf.vmftext.grammar.Alternative}.
*/
@SuppressWarnings("deprecation")
class ReadOnlyAlternativeImpl implements ReadOnlyAlternative, eu.mihosoft.vmf.runtime.core.internal.VObjectInternal, VCloneableInternal {
private final Alternative mutableObject;
// Read-only view for collection properties
// - properties with collection type (model & non-model collections)
// - we don't allow/provide setters for collection properties
private VList elements;
public ReadOnlyAlternativeImpl(Alternative mutableObject) {
this.mutableObject = mutableObject;
}
@Override
// generic type is a model-type
public VList getElements() {
// we return an unmodifiable mapped list that contains read-only versions of the list elements
// since read-only types and normal types are incompatible by design, we specify the lambda
// operation that converts an element into a read-only version of that element
if(this.elements == null) {
this.elements = VMappedList.newUnmodifiableInstance(mutableObject.getElements(), (e)->e.asReadOnly());
}
return this.elements;
}
@Override
public int getId() {
return this.mutableObject.getId();
}
@Override
// property type is a model-type
public ReadOnlyUPRuleBase getParentRule() {
if(this.mutableObject.getParentRule()!=null) {
return this.mutableObject.getParentRule().asReadOnly();
} else {
return null;
}
}
@Override
public java.lang.String getText() {
return this.mutableObject.getText();
}
// end for each property
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
((eu.mihosoft.vmf.runtime.core.internal.VObjectInternal)this.mutableObject).addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
((eu.mihosoft.vmf.runtime.core.internal.VObjectInternal)this.mutableObject).removePropertyChangeListener(l);
}
@Override
public String toString() {
return this.mutableObject.toString();
}
@Override
public boolean equals(Object o) {
return this.mutableObject.equals(o);
}
@Override
public int hashCode() {
return this.mutableObject.hashCode();
}
@Override
public Alternative _vmf_getMutableObject() {
return this.mutableObject;
}
@Override
public ReadOnlyAlternativeImpl asReadOnly() {
return this;
}
// --------------------------------------------------------------------
// --- Cloning
// --------------------------------------------------------------------
@Override
public ReadOnlyAlternative clone() {
return this.mutableObject.clone().asReadOnly();
}
@Override
public Alternative asModifiable() {
return this.mutableObject.clone();
}
@Override
public Alternative _vmf_deepCopy(
java.util.IdentityHashMap