Package edu.ucla.sspace.util

Examples of edu.ucla.sspace.util.LineReader


    public FileDocument(String fileName, boolean cacheContents)
            throws IOException {
        this.fileName = fileName;
        if (cacheContents) {
            StringBuilder sb = new StringBuilder();
            for (String line : new LineReader(new File(fileName)))
                sb.append(line).append('\n');
            contents = sb.toString();
        }
        else
            contents = null;
View Full Code Here


 
  filesToProcess = new ArrayDeque<String>();
        documentsToReturn = new ArrayBlockingQueue<Document>(bufferSize);

  // read in all the files we have to process
        for (String line : new LineReader(new File(fileListName)))
      filesToProcess.offer(line.trim());     

        remaining = new AtomicInteger(filesToProcess.size());
        bufferError = null;
View Full Code Here

        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

    }

    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

    }

    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

TOP

Related Classes of edu.ucla.sspace.util.LineReader

Copyright © 2018 www.massapicom. 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.