@Override public void parseStatus(String statusString) throws JmriException, IOException {
  ArrayList<Attribute> contents=parseOperationsMessage(statusString);
  ArrayList<Attribute> response=new ArrayList<Attribute>();
  String trainName=null;
  String tag;
  String value;
  for (  Attribute field : contents) {
    tag=field.getName();
    if (TRAIN.equals(tag)) {
      trainName=(String)field.getValue();
      response.add(field);
    }
 else     if (LOCATIONS.equals(tag)) {
      sendLocationList();
    }
 else     if (TRAINS.equals(tag)) {
      sendTrainList();
    }
 else     if (trainName != null) {
      if (TRAINLENGTH.equals(tag)) {
        value=constructTrainLength(trainName);
        if (value != null) {
          response.add(new Attribute(TRAINLENGTH,value));
        }
      }
 else       if (TRAINWEIGHT.equals(tag)) {
        value=constructTrainWeight(trainName);
        if (value != null) {
          response.add(new Attribute(TRAINWEIGHT,value));
        }
      }
 else       if (TRAINCARS.equals(tag)) {
        value=constructTrainNumberOfCars(trainName);
        if (value != null) {
          response.add(new Attribute(TRAINCARS,value));
        }
      }
 else       if (TRAINLEADLOCO.equals(tag)) {
        value=constructTrainLeadLoco(trainName);
        if (value != null) {
          response.add(new Attribute(TRAINLEADLOCO,value));
        }
      }
 else       if (TRAINCABOOSE.equals(tag)) {
        value=constructTrainCaboose(trainName);
        if (value != null) {
          response.add(new Attribute(TRAINCABOOSE,value));
        }
      }
 else       if (TRAINSTATUS.equals(tag)) {
        value=constructTrainStatus(trainName);
        if (value != null) {
          response.add(new Attribute(TRAINSTATUS,value));
        }
      }
 else       if (TERMINATE.equals(tag)) {
        value=terminateTrain(trainName);
        if (value != null) {
          response.add(new Attribute(TERMINATE,value));
        }
      }
 else       if (TRAINLOCATION.equals(tag)) {
        if (field.getValue() == null) {
          value=constructTrainLocation(trainName);
        }
 else {
          value=setTrainLocation(trainName,(String)field.getValue());
        }
        if (value != null) {
          response.add(new Attribute(TRAINLOCATION,value));
        }
      }
 else {
        throw new jmri.JmriException();
      }
    }
 else {
      throw new jmri.JmriException();
    }
  }
  if (response.size() > 1) {
    sendMessage(response);
  }
}

@ Override public void parseStatus ( String statusString ) throws JmriException , IOException { ArrayList < Attribute > contents = parseOperationsMessage ( statusString ) ; ArrayList < Attribute > response = new ArrayList < Attribute > ( ) ; String trainName = null ; String tag ; String value ; for ( Attribute field : contents ) { tag = field . getName ( ) ; if ( TRAIN . equals ( tag ) ) { trainName = ( String ) field . getValue ( ) ; response . add ( field ) ; } else if ( LOCATIONS . equals ( tag ) ) { sendLocationList ( ) ; } else if ( TRAINS . equals ( tag ) ) { sendTrainList ( ) ; } else if ( trainName != null ) { if ( TRAINLENGTH . equals ( tag ) ) { value = constructTrainLength ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TRAINLENGTH , value ) ) ; } } else if ( TRAINWEIGHT . equals ( tag ) ) { value = constructTrainWeight ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TRAINWEIGHT , value ) ) ; } } else if ( TRAINCARS . equals ( tag ) ) { value = constructTrainNumberOfCars ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TRAINCARS , value ) ) ; } } else if ( TRAINLEADLOCO . equals ( tag ) ) { value = constructTrainLeadLoco ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TRAINLEADLOCO , value ) ) ; } } else if ( TRAINCABOOSE . equals ( tag ) ) { value = constructTrainCaboose ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TRAINCABOOSE , value ) ) ; } } else if ( TRAINSTATUS . equals ( tag ) ) { value = constructTrainStatus ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TRAINSTATUS , value ) ) ; } } else if ( TERMINATE . equals ( tag ) ) { value = terminateTrain ( trainName ) ; if ( value != null ) { response . add ( new Attribute ( TERMINATE , value ) ) ; } } else if ( TRAINLOCATION . equals ( tag ) ) { if ( field . getValue ( ) == null ) { value = constructTrainLocation ( trainName ) ; } else { value = setTrainLocation ( trainName , ( String ) field . getValue ( ) ) ; } if ( value != null ) { response . add ( new Attribute ( TRAINLOCATION , value ) ) ; } } else { throw new jmri . JmriException ( ) ; } } else { throw new jmri . JmriException ( ) ; } } if ( response . size ( ) > 1 ) { sendMessage ( response ) ; } }
parse operation commands . they all start with " operations " followed by a command like " locations " . a command like " trainlength " requires a train name . the delimiter is the tab character .
