test_class.file: app/src/test/java/org/hwyl/sexytopo/control/io/thirdparty/survex/SurvexImporterTest.java
test_class.identifier: SurvexImporterTest
test_case.body: @Test
      public void testBasicImport() throws Exception {
          final String testContent =
                  "1\t2\t5.0\t0.0\t0.0";
          Survey survey = new Survey("Test");
          SurvexImporter.parse(testContent, survey);
          Assert.assertEquals(survey.getAllStations().size(), 2);
      }
test_case.class_method_signature: SurvexImporterTest.testBasicImport()
test_case.full_signature: @Test public void testBasicImport()
test_case.identifier: testBasicImport
test_case.invocations: parse assertEquals size getAllStations
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBasicImport()
focal_class.declarator: COMMENT_INSTRUCTION_REGEX = Pattern.compile("(\\{.*?\\})")
focal_class.modifier: public static final
focal_class.original_string: public static final Pattern COMMENT_INSTRUCTION_REGEX = Pattern.compile("(\\{.*?\\})");
focal_class.type: Pattern
focal_class.var_name: COMMENT_INSTRUCTION_REGEX
focal_class.file: app/src/main/java/org/hwyl/sexytopo/control/io/thirdparty/survex/SurvexImporter.java
focal_class.identifier: SurvexImporter
focal_class.class_method_signature: SurvexImporter.toSurvey(File file)
focal_class.full_signature: @Override public Survey toSurvey(File file)
focal_class.identifier: toSurvey
focal_class.modifiers: @Override public
focal_class.parameters: (File file)
focal_class.return: Survey
focal_class.signature: Survey toSurvey(File file)
focal_class.class_method_signature: SurvexImporter.parse(String text, Survey survey)
focal_class.full_signature: public static void parse(String text, Survey survey)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (String text, Survey survey)
focal_class.return: void
focal_class.signature: void parse(String text, Survey survey)
focal_class.class_method_signature: SurvexImporter.addLegToSurvey(
              Survey survey, Map<String, Station> nameToStation, String[] fields, String comment)
focal_class.full_signature: private static void addLegToSurvey(
              Survey survey, Map<String, Station> nameToStation, String[] fields, String comment)
focal_class.identifier: addLegToSurvey
focal_class.modifiers: private static
focal_class.parameters: (
              Survey survey, Map<String, Station> nameToStation, String[] fields, String comment)
focal_class.return: void
focal_class.signature: void addLegToSurvey(
              Survey survey, Map<String, Station> nameToStation, String[] fields, String comment)
focal_class.class_method_signature: SurvexImporter.retrieveOrCreateStation(Map<String, Station> nameToStation,
                                                     String name, String comment)
focal_class.full_signature: private static Station retrieveOrCreateStation(Map<String, Station> nameToStation,
                                                     String name, String comment)
focal_class.identifier: retrieveOrCreateStation
focal_class.modifiers: private static
focal_class.parameters: (Map<String, Station> nameToStation,
                                                     String name, String comment)
focal_class.return: Station
focal_class.signature: Station retrieveOrCreateStation(Map<String, Station> nameToStation,
                                                     String name, String comment)
focal_class.class_method_signature: SurvexImporter.extractCommentInstructions(String comment)
focal_class.full_signature: private static String extractCommentInstructions(String comment)
focal_class.identifier: extractCommentInstructions
focal_class.modifiers: private static
focal_class.parameters: (String comment)
focal_class.return: String
focal_class.signature: String extractCommentInstructions(String comment)
focal_class.class_method_signature: SurvexImporter.parseAnyPromotedLegs(String instructions)
focal_class.full_signature: public static Leg[] parseAnyPromotedLegs(String instructions)
focal_class.identifier: parseAnyPromotedLegs
focal_class.modifiers: public static
focal_class.parameters: (String instructions)
focal_class.return: Leg[]
focal_class.signature: Leg[] parseAnyPromotedLegs(String instructions)
focal_class.class_method_signature: SurvexImporter.canHandleFile(File file)
focal_class.full_signature: @Override public boolean canHandleFile(File file)
focal_class.identifier: canHandleFile
focal_class.modifiers: @Override public
focal_class.parameters: (File file)
focal_class.return: boolean
focal_class.signature: boolean canHandleFile(File file)
focal_class.superclass: extends Importer
focal_method.body: public static void parse(String text, Survey survey) throws Exception {
  
          Map<String, Station> nameToStation = new HashMap<>();
  
          String[] lines = text.split("\n");
          for (String line : lines) {
  
              String trimmed = line.trim();
              if (trimmed.equals("") || trimmed.startsWith(";") || trimmed.startsWith("*")) {
                  continue;
              }
  
              try {
                  String comment = "";
                  if (line.contains(";")) {
                      comment = line.substring(line.indexOf(";") + 1).trim();
                  }
  
                  String[] fields = line.trim().split("\\s+");
                  addLegToSurvey(survey, nameToStation, fields, comment);
  
              } catch (Exception exception) {
                  throw new Exception("Error importing this line: " + line);
              }
          }
      }
focal_method.class_method_signature: SurvexImporter.parse(String text, Survey survey)
focal_method.full_signature: public static void parse(String text, Survey survey)
focal_method.identifier: parse
focal_method.invocations: split trim equals startsWith startsWith contains trim substring indexOf split trim addLegToSurvey
focal_method.modifiers: public static
focal_method.parameters: (String text, Survey survey)
focal_method.return: void
focal_method.signature: void parse(String text, Survey survey)