获取某一行的第一个节点

@param line
@return
428494
public Vertex getFirst(int line)
    {
        Iterator<Vertex> iterator = vertexes[line].iterator();
        if (iterator.hasNext()) return iterator.next();

        return null;
    }
105377
private List<String> processLine(String line,
			BufferedReader buf,
			int fieldLength)
					throws IOException{

		//System.out.println("XX processLine " + fieldLength + " " + line);
		// go through the line and process each character
		List<String> lineData = new ArrayList<String>();

		boolean inString = false;

		StringBuilder bigWord = null;

		while ( true ){

			if ( line.startsWith(STRING_LIMIT)){
				if (! inString){

					inString = true;
					if ( line.length() > 1)
						bigWord = new StringBuilder(line.substring(1));
					else
						bigWord = new StringBuilder("");


				} else {
					// the end of a word
					lineData.add(bigWord.toString());
					bigWord = null;
					inString = false;

				}
			} else {
				if ( inString )
					bigWord.append(line);
				else {

					List<String> dat = processSingleLine(line);

					for (String d : dat){
						lineData.add(d);
					}
				}
			}

			//System.out.println("in process line : " + lineData.size() + " " + fieldLength);

			if ( lineData.size() > fieldLength){

				logger.warn("wrong data length ("+lineData.size()+
						") should be ("+fieldLength+") at line " + line + " got lineData: " + lineData);
				return lineData;
			}

			if ( lineData.size() == fieldLength)
				return lineData;


			line = buf.readLine();
			if ( line == null)
				break;
		}
		return lineData;

	}
749375
public final Reporter line(final String line, final Object... args) {
        counter++;
        wasEmptyLine = false;
        message.append(TAB).append(String.format(line, args)).append(NEWLINE);
        return this;
    }
77532
public synchronized TextBox addLine(String line) {
        StringBuilder bob = new StringBuilder();
        for(int i = 0; i < line.length(); i++) {
            char c = line.charAt(i);
            if(c == '\n' && style == Style.MULTI_LINE) {
                String string = bob.toString();
                int lineWidth = TerminalTextUtils.getColumnWidth(string);
                lines.add(string);
                if(longestRow < lineWidth + 1) {
                    longestRow = lineWidth + 1;
                }
                addLine(line.substring(i + 1));
                return this;
            }
            else if(Character.isISOControl(c)) {
                continue;
            }

            bob.append(c);
        }
        String string = bob.toString();
        if(!validated(string)) {
            throw new IllegalStateException("TextBox validation pattern " + validationPattern + " does not match the supplied text");
        }
        int lineWidth = TerminalTextUtils.getColumnWidth(string);
        lines.add(string);
        if(longestRow < lineWidth + 1) {
            longestRow = lineWidth + 1;
        }
        invalidate();
        return this;
    }
571314
private String getNextLine() {
    try {
      if (!this.linesSkiped) {
        for (int i = 0; i < skipLines; i++) {
          br.readLine();
        }
        this.linesSkiped = true;
      }
      String nextLine = br.readLine();
      if (nextLine == null) {
        hasNext = false;
      }
      return hasNext ? nextLine : null;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

  }
830733
public String getLine(int lineNumber, Janitor janitor) {
        // If the source is already open and is passed the line we
        // want, close it.
        if (lineSource != null && number > lineNumber) {
            cleanup();
        }

        // If the line source is closed, try to open it.
        if (lineSource == null) {
            try {
                lineSource = new BufferedReader(getReader());
            } catch (Exception e) {
                // Ignore
            }
            number = 0;
        }

        // Read until the appropriate line number.
        if (lineSource != null) {
            while (number < lineNumber) {
                try {
                    line = lineSource.readLine();
                    number++;
                }
                catch (IOException e) {
                    cleanup();
                }
            }

            if (janitor == null) {
                final String result = line;   // otherwise cleanup() will wipe out value
                cleanup();
                return result;
            } else {
                janitor.register(this);
            }
        }

        return line;
    }
830867
public static String buildStringFromLines(String... lines) {
		int numChars = lines.length;
		for (String line : lines) {
			numChars += line.length();
		}
		StringBuilder builder = new StringBuilder(numChars);
		for (String line : lines) {
			builder.append(line);
			builder.append('\n');
		}
		return builder.toString();
	}
72956
@Override
	protected final void processLine(String line, int level) {
		boolean isError = doProcessLine(line, level);
		if (isErrorStream || isError) {
			errorCount++;
		}
		lineCount++;
	}
186178
public void removeLine(final Line line)
    {
        if (line.previous == null)
        {
            this.lines = line.next;
        }
        else
        {
            line.previous.next = line.next;
        }
        if (line.next == null)
        {
            this.lineTail = line.previous;
        }
        else
        {
            line.next.previous = line.previous;
        }
        line.previous = line.next = null;
    }
356169
public boolean supports(final String line) {
        final List<String> splits = new ArrayList<String>();
        int depth = 0;
        int textDepth = 0;
        boolean escape = false;
        StringBuffer split = new StringBuffer();
        for (char c : line.toCharArray()) {
            if (depth == 0 && c == '.') {
                splits.add(split.toString());
                split = new StringBuffer();
                depth = 0;
                textDepth = 0;
                escape = false;
                continue;
            } else if (c == '\\') {
                escape = true;
                split.append(c);
                continue;
            } else if (textDepth == 0 && c == '"') {
                textDepth++;
            } else if (!escape && textDepth > 0 && c == '"') {
                textDepth--;
            } else if (textDepth == 0 && c == '(') {
                depth++;
            } else if (textDepth == 0 && c == ')') {
                depth--;
            }
            split.append(c);
            escape = false;
        }
        splits.add(split.toString());
        return splits.size() == 2;
    }
1004379
private String mkPreview(int line) {
        StringBuilder sb = new StringBuilder();
        int startLine = line - 3;
        int endLine = line + 3;
        List<String> lines = multiSourceReader.getData();
        for (int i = 0; i < lines.size(); i++) {
            if (i >= startLine && i <= endLine) {
                sb.append(lines.get(i)).append('\n');
            }
        }
        return sb.toString();
    }
220402
public static void print(final CharSequence line) {
        print(new Applyable<ConsoleReaderWrapper>() {
            public void apply(ConsoleReaderWrapper consoleReaderWrapper) {
                consoleReaderWrapper.print(line);
            }
        });
    }
101456
private String getTextLine(String[] textLines, int line)
	{
		return (isIgnoreTrailingWhiteSpaces()) ? textLines[line].trim() : textLines[line];
	}
170181
private boolean isBlankRow(String[] line)
    {
        boolean ret = true;
        for(int i = 0; i < line.length && ret; i++)
        {
            if(line[i] != null && line[i].trim().length() > 0)
                ret = false;
        }
        return ret;
    }
1243786
private LinkedList<String> toDisplayLines(String line) {
        LinkedList<String> displayLines = new LinkedList<String>();
        if (line.length() <= terminal.getWidth()) {
            displayLines.add(line);
        } else {
            int total = Math.max(0, line.length() - 1) / terminal.getWidth() + 1;
            int startIndex = 0;
            for (int l = 0; l < total; l++) {
                displayLines.add(line.substring(startIndex, Math.min(startIndex + terminal.getWidth(), line.length())));
                startIndex += terminal.getWidth();
            }
        }
        return displayLines;
    }
282740
public int getPosition(int line) {
        int result = -1;
        try {
            result = textArea.getLineStartOffset(line);
        } catch (javax.swing.text.BadLocationException exc) {
        }
        return result;
    }
693964
public void appendLine(final Line line)
    {
        if (this.lineTail == null)
        {
            this.lines = this.lineTail = line;
        }
        else
        {
            this.lineTail.nextEmpty = line.isEmpty;
            line.prevEmpty = this.lineTail.isEmpty;
            line.previous = this.lineTail;
            this.lineTail.next = line;
            this.lineTail = line;
        }
    }