private void mergeSOSNode(Node node) throws IIOInvalidTreeException {
  SOSMarkerSegment firstSOS=(SOSMarkerSegment)findMarkerSegment(SOSMarkerSegment.class,true);
  SOSMarkerSegment lastSOS=(SOSMarkerSegment)findMarkerSegment(SOSMarkerSegment.class,false);
  if (firstSOS != null) {
    if (firstSOS != lastSOS) {
      throw new IIOInvalidTreeException("Can't merge SOS node into a tree with > 1 SOS node",node);
    }
    firstSOS.updateFromNativeNode(node,false);
  }
 else {
    markerSequence.add(new SOSMarkerSegment(node));
  }
}

private void mergeSOSNode ( Node node ) throws IIOInvalidTreeException { SOSMarkerSegment firstSOS = ( SOSMarkerSegment ) findMarkerSegment ( SOSMarkerSegment . class , true ) ; SOSMarkerSegment lastSOS = ( SOSMarkerSegment ) findMarkerSegment ( SOSMarkerSegment . class , false ) ; if ( firstSOS != null ) { if ( firstSOS != lastSOS ) { throw new IIOInvalidTreeException ( "Can't merge SOS node into a tree with > 1 SOS node" , node ) ; } firstSOS . updateFromNativeNode ( node , false ) ; } else { markerSequence . add ( new SOSMarkerSegment ( node ) ) ; } }
merge the given sos node into the marker sequence . if there already exists a single sos marker segment , then the values are updated from the node . if there are more than one existing sos marker segments , then an iioinvalidtreeexception is thrown , as sos segments cannot be merged into a set of progressive scans . if there are no sos marker segments , a new one is created and added to the end of the sequence .
