/** * returns initial mode as true if it is a SOM without modes ("no Modes" aka NORMAL_SOM_NME) or if * all of the modes are initial mode */ @Override public final boolean isInitial() { if (isInitial == null) { Boolean value = Boolean.TRUE; final Iterator<ModeInstance> i = getCurrentModes().iterator(); // Is the list empty? if (!i.hasNext()) { // The SOM has no modes. Check to make sure, it is the only SOM, i.e., "No Modes". Otherwise // it is not initial if (((SystemInstance) eContainer()).getSystemOperationModes().size() != 1) { value = Boolean.FALSE; } } else { while (i.hasNext()) { final ModeInstance mi = i.next(); final Mode m = mi.getMode(); if (!m.isInitial()) { value = Boolean.FALSE; break; } } } isInitial = value; } return isInitial.booleanValue(); }