test_class.file: app/src/test/java/org/hwyl/sexytopo/control/io/basic/OldStyleLoaderTest.java
test_class.identifier: OldStyleLoaderTest
test_case.body: @Test
      public void testSimpleSurveyIsParsed() throws Exception {
          String text = "1\t2\t9.11\t121\t-23\n";
          Survey survey = new Survey("TestSurvey");
          OldStyleLoader.parse(text, survey);
          assert survey.getAllStations().size() == 2;
          assert survey.getOrigin().getConnectedOnwardLegs().get(0)
                  .getDestination().getName().equals("2");
  
      }
test_case.class_method_signature: OldStyleLoaderTest.testSimpleSurveyIsParsed()
test_case.full_signature: @Test public void testSimpleSurveyIsParsed()
test_case.identifier: testSimpleSurveyIsParsed
test_case.invocations: parse size getAllStations equals getName getDestination get getConnectedOnwardLegs getOrigin
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSimpleSurveyIsParsed()
focal_class.file: app/src/main/java/org/hwyl/sexytopo/control/io/basic/OldStyleLoader.java
focal_class.identifier: OldStyleLoader
focal_class.class_method_signature: OldStyleLoader.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: OldStyleLoader.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: OldStyleLoader.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_method.body: public static void parse(String text, Survey survey) throws Exception {
  
          Map<String, Station> nameToStation = new HashMap<>();
  
          Station origin = survey.getOrigin();
          nameToStation.put(origin.getName(), origin);
  
          String[] lines = text.split("\n");
          for (String line : lines) {
              line = line.trim();
              if (line.equals("") || line.startsWith("*")) {
                  continue;
              }
  
              String comment = "";
              if (line.contains("; ")) {
                  comment = line.substring(line.indexOf("; ") + 2);
                  comment = comment.replaceAll("\\\\n", "\n");
                  line = line.substring(0, line.indexOf("; "));
              }
  
              String[] fields = line.trim().split("\t");
              addLegToSurvey(survey, nameToStation, fields, comment);
          }
      }
focal_method.class_method_signature: OldStyleLoader.parse(String text, Survey survey)
focal_method.full_signature: public static void parse(String text, Survey survey)
focal_method.identifier: parse
focal_method.invocations: getOrigin put getName split trim equals startsWith contains substring indexOf replaceAll 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)