public boolean isMainlineIndexed(int index){
  RayTrack ray=null;
  for (int i=0; (i < rayList.size()) && (ray == null); i++) {
    RayTrack r=rayList.get(i);
    if (r.getConnectionIndex() == index) {
      ray=r;
    }
  }
  if (ray == null) {
    return false;
  }
  TrackSegment tr=ray.getConnect();
  if (tr == null) {
    return false;
  }
  return tr.getMainline();
}

public boolean isMainlineIndexed ( int index ) { RayTrack ray = null ; for ( int i = 0 ; ( i < rayList . size ( ) ) && ( ray == null ) ; i ++ ) { RayTrack r = rayList . get ( i ) ; if ( r . getConnectionIndex ( ) == index ) { ray = r ; } } if ( ray == null ) { return false ; } TrackSegment tr = ray . getConnect ( ) ; if ( tr == null ) { return false ; } return tr . getMainline ( ) ; }
methods to test if ray is a mainline track or not returns true if connecting track segment is mainline defaults to not mainline if connecting track segment is missing
