test_class.file: app/src/test/java/org/hwyl/sexytopo/control/io/thirdparty/xvi/XviImporterTest.java
test_class.identifier: XviImporterTest
test_case.body: @Test
      public void testParseSketchEntryParsesSecondEntry() throws Exception {
          String simpleText = "blue 0 0 1 0";
          PathDetail pathDetail = XviImporter.parseSketchEntry(1, simpleText);
          Assert.assertEquals(new Coord2D(1, 0), pathDetail.getPath().get(1));
          Assert.assertEquals(2, pathDetail.getPath().size());
      }
test_case.class_method_signature: XviImporterTest.testParseSketchEntryParsesSecondEntry()
test_case.full_signature: @Test public void testParseSketchEntryParsesSecondEntry()
test_case.identifier: testParseSketchEntryParsesSecondEntry
test_case.invocations: parseSketchEntry assertEquals get getPath assertEquals size getPath
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseSketchEntryParsesSecondEntry()
focal_class.declarator: instance = new XviImporter()
focal_class.modifier: private static
focal_class.original_string: private static XviImporter instance = new XviImporter();
focal_class.type: XviImporter
focal_class.var_name: instance
focal_class.file: app/src/main/java/org/hwyl/sexytopo/control/io/thirdparty/xvi/XviImporter.java
focal_class.identifier: XviImporter
focal_class.class_method_signature: XviImporter.toSurvey(File file)
focal_class.full_signature: public Survey toSurvey(File file)
focal_class.identifier: toSurvey
focal_class.modifiers: public
focal_class.parameters: (File file)
focal_class.return: Survey
focal_class.signature: Survey toSurvey(File file)
focal_class.class_method_signature: XviImporter.getSketch(File file)
focal_class.full_signature: public static Sketch getSketch(File file)
focal_class.identifier: getSketch
focal_class.modifiers: public static
focal_class.parameters: (File file)
focal_class.return: Sketch
focal_class.signature: Sketch getSketch(File file)
focal_class.class_method_signature: XviImporter.canHandleFile(File file)
focal_class.full_signature: public boolean canHandleFile(File file)
focal_class.identifier: canHandleFile
focal_class.modifiers: public
focal_class.parameters: (File file)
focal_class.return: boolean
focal_class.signature: boolean canHandleFile(File file)
focal_class.class_method_signature: XviImporter.parseGrid(String contents)
focal_class.full_signature: public Grid parseGrid(String contents)
focal_class.identifier: parseGrid
focal_class.modifiers: public
focal_class.parameters: (String contents)
focal_class.return: Grid
focal_class.signature: Grid parseGrid(String contents)
focal_class.class_method_signature: XviImporter.parseSketchlineBlock(double scale, String contents)
focal_class.full_signature: public static Set<PathDetail> parseSketchlineBlock(double scale, String contents)
focal_class.identifier: parseSketchlineBlock
focal_class.modifiers: public static
focal_class.parameters: (double scale, String contents)
focal_class.return: Set<PathDetail>
focal_class.signature: Set<PathDetail> parseSketchlineBlock(double scale, String contents)
focal_class.class_method_signature: XviImporter.parseBlockEntries(String content)
focal_class.full_signature: public static List<String> parseBlockEntries(String content)
focal_class.identifier: parseBlockEntries
focal_class.modifiers: public static
focal_class.parameters: (String content)
focal_class.return: List<String>
focal_class.signature: List<String> parseBlockEntries(String content)
focal_class.class_method_signature: XviImporter.parseSketchEntry(double scale, String entry)
focal_class.full_signature: public static PathDetail parseSketchEntry(double scale, String entry)
focal_class.identifier: parseSketchEntry
focal_class.modifiers: public static
focal_class.parameters: (double scale, String entry)
focal_class.return: PathDetail
focal_class.signature: PathDetail parseSketchEntry(double scale, String entry)
focal_class.class_method_signature: XviImporter.getBlockContents(String text, String command)
focal_class.full_signature: public static String getBlockContents(String text, String command)
focal_class.identifier: getBlockContents
focal_class.modifiers: public static
focal_class.parameters: (String text, String command)
focal_class.return: String
focal_class.signature: String getBlockContents(String text, String command)
focal_class.superclass: extends Importer
focal_method.body: public static PathDetail parseSketchEntry(double scale, String entry) throws IllegalArgumentException {
          List<String> tokens = Arrays.asList(entry.split(" "));
  
          if (tokens.size() <= 1) {
              throw new IllegalArgumentException("Incomplete token? {" + entry + "}");
          }
  
          String first = tokens.get(0);
          if (first.equals("connect")) {
              throw new IllegalArgumentException("Not sure what to do with token {" + entry + "}");
          }
  
          if (tokens.size() % 2 != 1) {
              throw new IllegalArgumentException(
                      "There was an odd number of data points in the token (excluding first item): "
                              + tokens.size());
          }
  
          Colour colour = Colour.valueOf(first.toUpperCase());
  
          List<Coord2D> points = new ArrayList<>(tokens.size() - 1);
          for (int i = 1; i < tokens.size();) {
              double x = Double.parseDouble(tokens.get(i++));
              double y = Double.parseDouble(tokens.get(i++));
  
              x /= scale;
              y /= scale;
  
              Coord2D coord2D = new Coord2D(x, -y);
              points.add(coord2D);
          }
  
          PathDetail pathDetail = new PathDetail(points.get(0), colour);
          for (Coord2D point : points.subList(1, points.size())) {
              pathDetail.lineTo(point);
          }
  
          return pathDetail;
      }
focal_method.class_method_signature: XviImporter.parseSketchEntry(double scale, String entry)
focal_method.full_signature: public static PathDetail parseSketchEntry(double scale, String entry)
focal_method.identifier: parseSketchEntry
focal_method.invocations: asList split size get equals size size valueOf toUpperCase size size parseDouble get parseDouble get add get subList size lineTo
focal_method.modifiers: public static
focal_method.parameters: (double scale, String entry)
focal_method.return: PathDetail
focal_method.signature: PathDetail parseSketchEntry(double scale, String entry)