Ejemplo n.º 1
0
  public boolean identityEquals(Object elem) {
    if (!(elem instanceof ElementInMove_c)) {
      return false;
    }

    ElementInMove_c me = (ElementInMove_c) elem;
    // don't allow an empty id-value to produce a false positive result;
    // in this case, use whether the two instances are actually the same
    // one in memory, instead
    if (!getModelRoot().isCompareRoot()
        && ((IdAssigner.NULL_UUID.equals(getElementid())
                || IdAssigner.NULL_UUID.equals(((ElementInMove_c) elem).getElementid()))
            && this != elem)) {
      return false;
    }
    if (!getElementid().equals(((ElementInMove_c) elem).getElementid())) return false;
    // don't allow an empty id-value to produce a false positive result;
    // in this case, use whether the two instances are actually the same
    // one in memory, instead
    if (!getModelRoot().isCompareRoot()
        && ((IdAssigner.NULL_UUID.equals(getDiagramid())
                || IdAssigner.NULL_UUID.equals(((ElementInMove_c) elem).getDiagramid()))
            && this != elem)) {
      return false;
    }
    if (!getDiagramid().equals(((ElementInMove_c) elem).getDiagramid())) return false;
    return true;
  }
Ejemplo n.º 2
0
  public boolean identityEquals(Object elem) {
    if (!(elem instanceof DataTypeInPackage_c)) {
      return false;
    }

    DataTypeInPackage_c me = (DataTypeInPackage_c) elem;
    // don't allow an empty id-value to produce a false positive result;
    // in this case, use whether the two instances are actually the same
    // one in memory, instead
    if ((IdAssigner.NULL_UUID.equals(getPackage_id())
            || IdAssigner.NULL_UUID.equals(((DataTypeInPackage_c) elem).getPackage_id()))
        && this != elem) {
      return false;
    }
    if (!getPackage_id().equals(((DataTypeInPackage_c) elem).getPackage_id())) return false;
    // don't allow an empty id-value to produce a false positive result;
    // in this case, use whether the two instances are actually the same
    // one in memory, instead
    if ((IdAssigner.NULL_UUID.equals(getDt_id())
            || IdAssigner.NULL_UUID.equals(((DataTypeInPackage_c) elem).getDt_id()))
        && this != elem) {
      return false;
    }
    if (!getDt_id().equals(((DataTypeInPackage_c) elem).getDt_id())) return false;
    return true;
  }
Ejemplo n.º 3
0
  public void unrelateAcrossR301From(Graphelement_c target, boolean notifyChanges) {
    if (target == null) return;

    if (IsSupertypeGraphelement == null) return; // already unrelated

    if (target != IsSupertypeGraphelement) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CanvasPlugin.logError("Tried to unrelate from non-related instance across R301", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR301To(this);
    }

    if (IsSupertypeGraphelement != null) {

      m_elementid = IsSupertypeGraphelement.getElementid();
      if (IdAssigner.NULL_UUID.equals(m_elementid)) {
        m_elementid = IsSupertypeGraphelement.getElementidCachedValue();
      }
      IsSupertypeGraphelement = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "301", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 4
0
  public void unrelateAcrossR39From(DataType_c target, boolean notifyChanges) {
    if (target == null) return;

    if (ContainsDataType == null) return; // already unrelated

    if (target != ContainsDataType) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R39", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR39To(this);
    }

    if (ContainsDataType != null) {

      m_dt_id = ContainsDataType.getDt_id();
      if (IdAssigner.NULL_UUID.equals(m_dt_id)) {
        m_dt_id = ContainsDataType.getDt_idCachedValue();
      }
      ContainsDataType = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "39", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void unrelateAcrossR518From(ModelClass_c target, boolean notifyChanges) {
    if (target == null) return;

    if (ModelClass == null) return; // already unrelated

    if (target != ModelClass) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R518", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR518To(this);
    }

    if (ModelClass != null) {

      m_obj_id = ModelClass.getObj_id();
      if (IdAssigner.NULL_UUID.equals(m_obj_id)) {
        m_obj_id = ModelClass.getObj_idCachedValue();
      }
      ModelClass = null;
      target.removeRef();
      UmlProblem.removeXtUMLProblem(this, target);
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "518", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 6
0
  public String getCompUniqueID() {
    UUID tempID = null;
    long longID = 0L;
    StringBuffer result = new StringBuffer();

    tempID = getPackage_id();

    if (IdAssigner.NULL_UUID.equals(tempID)) tempID = getPackage_idCachedValue();
    result.append(Long.toHexString(tempID.getMostSignificantBits()));
    result.append(Long.toHexString(tempID.getLeastSignificantBits()));
    tempID = getDt_id();

    if (IdAssigner.NULL_UUID.equals(tempID)) tempID = getDt_idCachedValue();
    result.append(Long.toHexString(tempID.getMostSignificantBits()));
    result.append(Long.toHexString(tempID.getLeastSignificantBits()));
    return result.toString();
  }
  public boolean identityEquals(Object elem) {
    if (!(elem instanceof ComponentResultSet_c)) {
      return false;
    }

    ComponentResultSet_c me = (ComponentResultSet_c) elem;
    if (!getName().equals(((ComponentResultSet_c) elem).getName())) return false;
    if (getType() != ((ComponentResultSet_c) elem).getType()) return false;
    // don't allow an empty id-value to produce a false positive result;
    // in this case, use whether the two instances are actually the same
    // one in memory, instead
    if (!getModelRoot().isCompareRoot()
        && ((IdAssigner.NULL_UUID.equals(getId())
                || IdAssigner.NULL_UUID.equals(((ComponentResultSet_c) elem).getId()))
            && this != elem)) {
      return false;
    }
    if (!getId().equals(((ComponentResultSet_c) elem).getId())) return false;
    return true;
  }
  public void relateAcrossR518To(ModelClass_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == ModelClass) return; // already related

    if (ModelClass != target) {

      Object oldKey = getInstanceKey();

      if (ModelClass != null) {
        UmlProblem.removeXtUMLProblem(this, ModelClass);

        ModelClass.clearBackPointerR518To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "InstanceStateMachine_c.relateAcrossR518To(ModelClass_c target)",
              "Relate performed across R518 from Instance State Machine to Model Class without unrelate of prior instance.");
        }
      }

      ModelClass = target;
      if (IdAssigner.NULL_UUID.equals(target.getObj_id())) {
        // do not update cached value
      } else {
        // update cached value
        m_obj_id = target.getObj_idCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR518To(this);
      target.addRef();
      UmlProblem.handleDanglingReference(this, target);
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "518", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 9
0
  public void relateAcrossR301To(Graphelement_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == IsSupertypeGraphelement) return; // already related

    if (IsSupertypeGraphelement != target) {

      Object oldKey = getInstanceKey();

      if (IsSupertypeGraphelement != null) {

        IsSupertypeGraphelement.clearBackPointerR301To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofgraphics.log.println(
              ILogger.CONSISTENCY,
              "Graphnode_c.relateAcrossR301To(Graphelement_c target)",
              "Relate performed across R301 from GraphNode to GraphElement without unrelate of prior instance.");
        }
      }

      IsSupertypeGraphelement = target;
      if (IdAssigner.NULL_UUID.equals(target.getElementid())) {
        // do not update cached value
      } else {
        // update cached value
        m_elementid = target.getElementidCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR301To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "301", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 10
0
  public void relateAcrossR39To(DataType_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == ContainsDataType) return; // already related

    if (ContainsDataType != target) {

      Object oldKey = getInstanceKey();

      if (ContainsDataType != null) {

        ContainsDataType.clearBackPointerR39To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "DataTypeInPackage_c.relateAcrossR39To(DataType_c target)",
              "Relate performed across R39 from Data Type in Package to Data Type without unrelate of prior instance.");
        }
      }

      ContainsDataType = target;
      if (IdAssigner.NULL_UUID.equals(target.getDt_id())) {
        // do not update cached value
      } else {
        // update cached value
        m_dt_id = target.getDt_idCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR39To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "39", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 11
0
  public void relateAcrossR4202To(Component_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == CanBeNestedInComponent) return; // already related

    if (CanBeNestedInComponent != target) {

      Object oldKey = getInstanceKey();

      if (CanBeNestedInComponent != null) {

        CanBeNestedInComponent.clearBackPointerR4202To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "ComponentInComponent_c.relateAcrossR4202To(Component_c target)",
              "Relate performed across R4202 from Component in Component to Component without unrelate of prior instance.");
        }
      }

      CanBeNestedInComponent = target;
      if (IdAssigner.NULL_UUID.equals(target.getId())) {
        // do not update cached value
      } else {
        // update cached value
        m_parent_id = target.getIdCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR4202To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "4202", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 12
0
 public java.util.UUID getArg_idCachedValue() {
   if (!IdAssigner.NULL_UUID.equals(m_arg_id)) return m_arg_id;
   else return getArg_id();
 }
Ejemplo n.º 13
0
 // declare attribute accessors
 public long getIdLongBased() {
   if (m_idLongBased == 0 && !IdAssigner.NULL_UUID.equals(m_id)) {
     return 0xfffffff & m_id.getLeastSignificantBits();
   }
   return m_idLongBased;
 }