public int addSegmentList(int index,WKTSegmentList segmentListToAdd){
  List<WKTSegmentList> localSegmentList=null;
  if (index < 0) {
    return -1;
  }
 else {
    if (index >= segmentList.size()) {
      localSegmentList=new ArrayList<WKTSegmentList>();
      segmentList.add(localSegmentList);
    }
 else {
      localSegmentList=segmentList.get(index);
    }
    localSegmentList.add(segmentListToAdd);
  }
  return localSegmentList.size() - 1;
}

public int addSegmentList ( int index , WKTSegmentList segmentListToAdd ) { List < WKTSegmentList > localSegmentList = null ; if ( index < 0 ) { return - 1 ; } else { if ( index >= segmentList . size ( ) ) { localSegmentList = new ArrayList < WKTSegmentList > ( ) ; segmentList . add ( localSegmentList ) ; } else { localSegmentList = segmentList . get ( index ) ; } localSegmentList . add ( segmentListToAdd ) ; } return localSegmentList . size ( ) - 1 ; }
adds the segment list .
