Examples of LineReader


Examples of edu.ucla.sspace.util.LineReader

        int lineNo = 0;
        boolean seenVertices = false;
        boolean seenEdges = false;
        Map<String,Integer> labelToVertex = new HashMap<String,Integer>();

        for (String line : new LineReader(f)) {
            ++lineNo;
            // Skip comments and blank lines
            if (line.matches("\\s*%.*") || line.matches("\\s+"))
                continue;
            else if (line.startsWith("*vertices")) {
View Full Code Here

Examples of edu.ucla.sspace.util.LineReader

    }

    public DirectedGraph<DirectedEdge> readDirectedGraph(File dotFile) {
        DirectedGraph<DirectedEdge> g = new SparseDirectedGraph();
        // REMINDER: add a lot more error checking
        for (String line : new LineReader(dotFile)) {
            // System.out.println(line);
            Matcher m = DIRECTED_EDGE.matcher(line);
            while (m.find()) {
                String from = m.group(1);
                String to = m.group(2);
View Full Code Here

Examples of edu.ucla.sspace.util.LineReader

    }

    public DirectedMultigraph readDirectedMultigraph(File dotFile) {
        DirectedMultigraph<String> g = new DirectedMultigraph<String>();
        // REMINDER: add a lot more error checking
        for (String line : new LineReader(dotFile)) {
            Matcher m = DIRECTED_EDGE.matcher(line);
            while (m.find()) {
                String from = m.group(1);
                String to = m.group(2);
                String meta = m.group(3);
View Full Code Here

Examples of eu.stratosphere.runtime.fs.LineReader

      final FileSystem fs = FileSystem.get(split.getPath().toUri());

      final FSDataInputStream fdis = fs.open(split.getPath());

      final LineReader lineReader = new LineReader(fdis, start, length, (1024 * 1024));

      byte[] line = lineReader.readLine();

      while (line != null) {

        // Create a string object from the data read
        StringRecord str = new StringRecord();
        str.set(line);

        // Send out string
        output.emit(str);

        line = lineReader.readLine();
      }

      // Close the stream;
      lineReader.close();
    }

    this.output.flush();
  }
View Full Code Here

Examples of fr.pingtimeout.jtail.io.LineReader

        // Lorsque l'indexation est terminée, créer le JTailModel et l'ajouter dans l'application
        if ((Integer) arg == 100) {
            final FileIndexer fileIndexer = (FileIndexer) o;
            final File file = fileIndexer.getFile();
            try {
                final LineReader lineReader = new LineReader(file, fileIndexer.getIndex());
                final JTailModel model = new JTailModel(file, lineReader);
                this.jTailMainModel.add(model);
            } catch (FileNotFoundException e) {
                ExceptionHandler.handle(e, UIMessage.ERROR_FILE_NOT_FOUND, file.getName());
            } catch (Exception e) {
View Full Code Here

Examples of fr.zenexity.pdt.editors.IO.LineReader

  @Override
  public void check() {
    if (getSeverity() < 0) return; // Preference says to ignore missing routes
    try {
      IO.readLines(file, new LineReader() {
        @Override
        public void readLine(String line, int lineNumber, int offset) {
          if (comment.matcher(line).find()) {
            // commented line
            return;
View Full Code Here

Examples of freenet.support.io.LineReader

    assertEquals(sfs.toOrderedString(), key+"="+value+"\nEnd\n");
    StringWriter sw = new StringWriter();
    sfs.writeTo(sw, "", false, true);
    String written = sw.toString();
    assertEquals(written, key+"=="+base64Value+"\nEnd\n");
    LineReader r = Readers.fromBufferedReader(new BufferedReader(new StringReader(written)));
    SimpleFieldSet sfsCheck = new SimpleFieldSet(r, 1024, 1024, true, false, true, true);
    assertEquals(sfsCheck.get(key), value);
  }
View Full Code Here

Examples of freenet.support.io.LineReader

    assertEquals(sfsCheck.get(key), value);
  }
 
  public void testEmptyValue() throws IOException {
    String written = "foo.blah=\nEnd\n";
    LineReader r = Readers.fromBufferedReader(new BufferedReader(new StringReader(written)));
    SimpleFieldSet sfsCheck = new SimpleFieldSet(r, 1024, 1024, true, false, true, false);
    assertTrue(sfsCheck.get("foo.blah").equals(""));
    r = Readers.fromBufferedReader(new BufferedReader(new StringReader(written)));
    sfsCheck = new SimpleFieldSet(r, 1024, 1024, true, false, true, true);
    assertTrue(sfsCheck.get("foo.blah").equals(""));
View Full Code Here

Examples of htsjdk.samtools.util.LineReader

        InputStream is = null;
        try {
            URL url = new URL(getHeaderURL());
            is = HttpUtils.getInstance().openConnectionStream(url);

            LineReader reader = new BufferedLineReader(is);
            SAMTextHeaderCodec codec = new SAMTextHeaderCodec();
            header = codec.decode(reader, null);

        } catch (Exception ex) {
            log.info("Error loading header : " + ex.getMessage());
View Full Code Here

Examples of joshua.util.io.LineReader

    // we try...finally to be sure we close the reader.
    // reader.close may throw IOException or unchecked,
    // so we try...finally to ensure that we finish the
    // coiterator.
    try {
      LineReader reader = new LineReader(in);
      int i = 0;
      try {
        while (reader.hasNext()) {
         
          coit.coNext(new PlainSegment(
            Integer.toString(i),
            Regex.spaces.replaceAll(reader.next(), " ").trim() ));
         
          ++i;
        }
      } finally {
        reader.close();
      }
    } finally {
      coit.finish();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.