private boolean addLifeline(Lifeline lifeline) throws SemanticError {
  if (lifeline.getDiagram() != this) {
    throw new IllegalArgumentException("cannot add a lifeline of another diagram");
  }
  if (lifelineMap.get(lifeline.getName()) != null) {
    throw new SemanticError(provider,lifeline.getName() + " already exists");
  }
  if (lifeline.hasThread()) {
    if (!threaded) {
      throw new SemanticError(provider,lifeline.getName() + " cannot have its own thread when multithreading is not enabled");
    }
    int thread=spawnThread();
    first.set(thread,lifeline);
    lifeline.setThread(thread);
  }
  if (!lifeline.isVariable()) {
    positionMap.put(lifeline.getName(),add(lifeline));
  }
  lifelineMap.put(lifeline.getName(),lifeline);
  return true;
}

private boolean addLifeline ( Lifeline lifeline ) throws SemanticError { if ( lifeline . getDiagram ( ) != this ) { throw new IllegalArgumentException ( "cannot add a lifeline of another diagram" ) ; } if ( lifelineMap . get ( lifeline . getName ( ) ) != null ) { throw new SemanticError ( provider , lifeline . getName ( ) + " already exists" ) ; } if ( lifeline . hasThread ( ) ) { if ( ! threaded ) { throw new SemanticError ( provider , lifeline . getName ( ) + " cannot have its own thread when multithreading is not enabled" ) ; } int thread = spawnThread ( ) ; first . set ( thread , lifeline ) ; lifeline . setThread ( thread ) ; } if ( ! lifeline . isVariable ( ) ) { positionMap . put ( lifeline . getName ( ) , add ( lifeline ) ) ; } lifelineMap . put ( lifeline . getName ( ) , lifeline ) ; return true ; }
adds a new ( root ) lifeline for an object with the name and type given .
