Пример #1
0
 /**
  * Renames the identifier for object instance o in this state to newName.
  *
  * @param o the object instance to rename in this state
  * @param newName the new name of the object instance
  */
 public void renameObject(ObjectInstance o, String newName) {
   String originalName = o.getName();
   o.setName(newName);
   objectMap.remove(originalName);
   objectMap.put(newName, o);
 }
Пример #2
0
 /**
  * Renames the identifier for the object instance currently named originalName with the name
  * newName.
  *
  * @param originalName the original name of the object instance to be renamed in this state
  * @param newName the new name of the object instance
  */
 public void renameObject(String originalName, String newName) {
   ObjectInstance o = objectMap.get(originalName);
   o.setName(newName);
   objectMap.remove(originalName);
   objectMap.put(newName, o);
 }