Package data

Examples of data.Line


            b = Math.min(lineBuffer.size() - 1, i + lineTolerance);
            line = "";
            linesToCheck.clear();

            for (int j = a; j <= b; j++) {
                linesToCheck.add(new Line(lineBuffer.get(j), j + 1)); //j+1 represents the line number
                line += lineBuffer.get(j) + "\f";
            }

            if (lineMatcher.match(pattern, line)) {
                LineMatch lineMatch = new LineMatch(pattern);
View Full Code Here


            }
        }
    }

    private void addDisplayWindowLines(List<String> lineBuffer, List<Line> lines) {
        Line firstLine = null;
        Line lastLine = null;
        int a = 0;
        int b = 0;
        int displayWindow = props.getDisplayProperties().getDisplayWindow();

        if (lineBuffer == null || lines == null) {
            throw new IllegalArgumentException("One ore more parameters are null!");
        }

        if (displayWindow == 0 || lines.size() == 0) {
            return;
        }

        firstLine = lines.get(0);
        lastLine = lines.get(lines.size() - 1);

        a = Math.max(0, firstLine.getLineNumber() - 1 - displayWindow);
        b = firstLine.getLineNumber() - 1;

        for (int i = b - 1; i >= a; i--) {
            lines.add(0, new Line(lineBuffer.get(i), i + 1));
        }

        a = lastLine.getLineNumber() - 1;
        b = Math.min(lineBuffer.size() - 1, lastLine.getLineNumber() - 1 + displayWindow);

        for (int i = a + 1; i <= b; i++) {
            lines.add(new Line(lineBuffer.get(i), i + 1));
        }

    }
View Full Code Here

TOP

Related Classes of data.Line

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.