Package java.io

Examples of java.io.LineNumberReader.readLine()


    private Profile() {
        FileReader reader = null;
        try {
            reader = new FileReader("profile.txt");
            LineNumberReader r = new LineNumberReader(reader);
            while (r.readLine() != null) {
                // nothing - just count lines
            }
            maxIndex = r.getLineNumber();
            count = new int[maxIndex];
            time = new int[maxIndex];
View Full Code Here


            fileWriter = new FileWriter("notCovered.txt");
            BufferedWriter writer = new BufferedWriter(fileWriter);
            int unvisited = 0;
            int unvisitedThrow = 0;
            for (int i = 0; i < maxIndex; i++) {
                String line = r.readLine();
                if (count[i] == 0) {
                    if (!line.endsWith("throw")) {
                        writer.write(line + "\r\n");
                        if (LIST_UNVISITED) {
                            print(line + "\r\n");
View Full Code Here

        FileReader reader = null;
        try {
            reader = new FileReader("profile.txt");
            LineNumberReader r = new LineNumberReader(reader);
            for (int i = 0; i < maxIndex; i++) {
                String line = r.readLine();
                int k = list[i];
                if (k < 0) {
                    k = -(k + 1);
                    list[i] = k;
                    for (int j = 0; j < max; j++) {
View Full Code Here

        //  read the song from the file
        BufferedReader brSrc = new BufferedReader(new FileReader(fileSrc));
        LineNumberReader lnrSrc = new LineNumberReader(brSrc);
       
        Pattern song = new Pattern();
        for (String s = lnrSrc.readLine(); s != null; s = lnrSrc.readLine())
        {  if (s.length() > 0)
            if (s.charAt(0) != '#')
              song.add(s);
        }
        lnrSrc.close();
View Full Code Here

        //  read the song from the file
        BufferedReader brSrc = new BufferedReader(new FileReader(fileSrc));
        LineNumberReader lnrSrc = new LineNumberReader(brSrc);
       
        Pattern song = new Pattern();
        for (String s = lnrSrc.readLine(); s != null; s = lnrSrc.readLine())
        {  if (s.length() > 0)
            if (s.charAt(0) != '#')
              song.add(s);
        }
        lnrSrc.close();
View Full Code Here

        IRIImpl last = null;
        DEBUG = true;

        IRIFactory factory = IRIFactory.iriImplementation();
        while (true) {
            String s = in.readLine().trim();
            if (s.equals("quit"))
                return;
            IRIImpl iri = (IRIImpl) factory.create(s);
            show(iri);
View Full Code Here

                    check(args[i]);
            else {
                LineNumberReader rdr = new LineNumberReader(
                        new InputStreamReader(in));
                while (true) {
                    String line = rdr.readLine();
                    if (line == null)
                        return;
                    check(line);
                }
            }
View Full Code Here

            try {
                socket = serverSocket.accept();
                socket.setSoLinger(false, 0);
                LineNumberReader lin = new LineNumberReader(new InputStreamReader(socket.getInputStream()));

                String key = lin.readLine();
                if (!this.key.equals(key)) {
                    continue;
                }
                String cmd = lin.readLine();
                if ("stop".equals(cmd)) {
View Full Code Here

                String key = lin.readLine();
                if (!this.key.equals(key)) {
                    continue;
                }
                String cmd = lin.readLine();
                if ("stop".equals(cmd)) {
                    try {
                        socket.close();
                    } catch (Exception e) {
                        LOGGER.debug("Exception when stopping server", e);
View Full Code Here

        }
        javaWriter.println("public class " + cn + " {");
        javaWriter.println("    public static void main(String... args) throws Exception {");
        javaWriter.println("        Class.forName(\"org.h2.Driver\");");
        while (true) {
            String line = reader.readLine();
            if (line == null) {
                break;
            }
            if (line.startsWith("/**/")) {
                line = "        " + line.substring(4);
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.