public static Location location ( List < Location > subLocations , String type ) { if ( subLocations . size ( ) == 1 ) { return subLocations . get ( 0 ) ; } boolean circular = detectCicular ( subLocations ) ; Strand strand = detectStrand ( subLocations ) ; Point start = detectStart ( subLocations ) ; Point end = detectEnd ( subLocations , circular ) ; Location l ; if ( "join" . equals ( type ) ) { l = new SimpleLocation ( start , end , strand , circular , subLocations ) ; } else if ( "order" . equals ( type ) ) { l = new InsdcLocations . OrderLocation ( start , end , strand , circular , subLocations ) ; } else if ( "one-of" . equals ( type ) ) { l = new InsdcLocations . OneOfLocation ( subLocations ) ; } else if ( "group" . equals ( type ) ) { l = new InsdcLocations . GroupLocation ( start , end , strand , circular , subLocations ) ; } else if ( "bond" . equals ( type ) ) { l = new InsdcLocations . BondLocation ( subLocations ) ; } else { throw new ParserException ( "Unknown join type " + type ) ; } return l ; }
Builds a location from a List of locations ; this can be circular or linear joins . The code expects that these locations are in a sensible format .