s = mem.fetchSignal();
Item[] c = mem.getChildren();  if (c != null) {  int index = 0; int no = mem.getChildrenNumber(); Signal child = null; String n = null; Integer priority = null; Integer max = new Integer(0);  while (index < no) {  child = (Signal) c[index];  if (child != null) {  n = child.getName();  if (n != null) {  if (n.startsWith(Component.SIGNAL)) {  priority = (Integer) child.get(Signal.PRIORITY);  if (priority != null) {  if (priority.isGreaterThan(max)) {  max = priority; s = child; }  } else {  throw new NullPointerException("Could not fetch signal. The priority is null."); } }  } else {  throw new NullPointerException("Could not fetch signal. The name is null."); }  } else {  throw new NullPointerException("Could not fetch signal. A child is null."); }  index++; }  if (s != null) {  mem.remove(s.getName()); }  } else {  throw new NullPointerException("Could not place signal. The signal memory is null."); }
    public Signal fetchSignal() throws NullPointerException {        Signal s = null;        SignalMemory mem = (SignalMemory) get(Component.SIGNAL_MEMORY);        if (mem != null) {            s = mem.fetchSignal();        } else {            throw new NullPointerException("Could not place signal. The signal memory is null.");        }                return s;    }