Returns the items from the comma delimited NMEA line. The last item
always contains a * followed by a checksum. If * is not present
{@link IndexOutOfBoundsException} will be thrown.

@param line
@return
184063
private static String[] getNmeaItems(String line) {
        String[] items = StringUtils.splitByWholeSeparatorPreserveAllTokens(line,
                PARAMETER_DELIMITER);
        // remove the checksum from the end
        String last = items[items.length - 1];
        if (last.contains("*"))
            items[items.length - 1] = last.substring(0, last.lastIndexOf('*'));
        return items;
    }
1103883
@Override
  public void onOutputLine(String line) {
    if (waitLatch.getCount() > 0 && message != null && line.matches(message)) {
      waitLatch.countDown();
    }
  }
465527
@Override
    public List<MonitorLine> getLinesFrom(Object actual) throws Exception {
        //TODO Enhance line retrieve to get last lines directly
        String line;
        Integer currentLineNo = 0;
        final List<MonitorLine> result = new ArrayList<MonitorLine>();
        BufferedReader in = null;
        try {
            in = new BufferedReader(new FileReader(getFilename()));

            Integer startLine = (actual == null) ? 0 : (Integer) actual;
            //read to startLine
            while (currentLineNo < startLine + 1) {
                if (in.readLine() == null) {
                    throw new IOException("File too small");
                }
                currentLineNo++;
            }
            //read until endLine
            line = in.readLine();
            while (line != null) {
                result.add(new MonitorLine(currentLineNo, line));
                currentLineNo++;
                line = in.readLine();
            }
        } finally {
            try {
                if (in != null) {
                    in.close();
                }
            } catch (IOException ignore) {
            }
        }
        return result;
    }
101456
private String getTextLine(String[] textLines, int line)
	{
		return (isIgnoreTrailingWhiteSpaces()) ? textLines[line].trim() : textLines[line];
	}
619359
public static CaptureSearchResult parseCDXLineFlexFast(String line) {	
		CaptureSearchResult result = new FastCaptureSearchResult();
		return parseCDXLineFlex(line, result);
	}
393111
private int findIndex(String line) {

        int index = -1;

        if (line == null) {
            return index;
        }

        String trimmedLine = line.trim();
        int spaceIndex = trimmedLine.indexOf(" ");
        int tabIndex = trimmedLine.indexOf("\t");

        if (spaceIndex != -1) {
            if (tabIndex != -1) {
                if (spaceIndex < tabIndex) {
                    index = spaceIndex;
                } else {
                    index = tabIndex;
                }
            } else {
                index = spaceIndex;
            }
        } else {
            index = tabIndex;
        }
        return index;
    }
975084
public static String[] parse(final String line) {
        boolean insideQuote = false;
        final ArrayList<String> result = new ArrayList<>();
        int quoteCount = 0;
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < line.length(); i++) {
            final char c = line.charAt(i);

            if (c == QUOTE) {
                insideQuote = !insideQuote;
                quoteCount++;
            }

            if (c == COMMA && !insideQuote) {
                String value = sb.toString();
                value = unQuoteUnEscape(value);
                result.add(value);
                sb.setLength(0);
                continue;
            }

            sb.append(c);
        }

        result.add(sb.toString());

        // Validate
        if (quoteCount % 2 != 0) {
            return new String[0];
        }

        return result.toArray(new String[result.size()]);
    }
191716
public boolean isNewLine(String line, int index) {
        return index > lastIndex || (index == lastIndex && !Objects.equals(line, lastLine));
    }
391028
public static List<String> parse(String line)
	{
		
		if(line == null || line.length() ==0)
			return null;
		
		final short START = 2;
		final short TERM = 3;
		final short QUOTED_TERM = 4;
		final short start_ESCAPEDDOUBLEQUOTE =5;
		
		short state = START;
		
		int length = line.length();
		ArrayList<String> tokens = new ArrayList<>(10);
		
		StringBuilder buffer = new StringBuilder();
		
		char currentChar;
		for (int i = 0; i < length; i++)
		{
			currentChar = line.charAt(i);
			
			switch(state)
			{
				case START:
					if(currentChar == '"')
					{
						state = QUOTED_TERM;
					}
					else if(currentChar != ',')
					{
						  state = TERM;
						  buffer.append(currentChar);
					}

				break; 
				case QUOTED_TERM:
					if(currentChar != '"')
					{
						buffer.append(currentChar);
					}
					else
					{
						if(line.length() > (i+ 1) && line.charAt(i+1) != '"')
						{
							state = START;
							tokens.add(buffer.toString());
							buffer.setLength(0);							
						}
						else if(line.length() > (i+ 1) && line.charAt(i+1) == '"')
						{
							state = start_ESCAPEDDOUBLEQUOTE;
						}
					}
				break;
				case start_ESCAPEDDOUBLEQUOTE:
					
					buffer.append(currentChar);

					state = QUOTED_TERM;
				break;
				case TERM: 
					if(currentChar == ',')
					{
						state = START;
						
						if(buffer.length() > 0)
						{
							tokens.add(buffer.toString());
							buffer.setLength(0);
						}
						
					}
					else if(currentChar == '"' && line.charAt(i+1) == '"' )
					{
						state = start_ESCAPEDDOUBLEQUOTE;
					}
					else
							buffer.append(line.charAt(i));
				break;
				default: throw new RuntimeException("Unknown parse state:"+state);
			}
		}
		
		if(buffer.length() > 0)
			tokens.add(buffer.toString());
			
		tokens.trimToSize();
		
		if(tokens.isEmpty())
			return null;
		
		return tokens;
	
	}
130449
private String segmenterNonBreaker(String line) {

    // these are fine because they do not affect offsets
    line = line.trim();
    line = RuleBasedTokenizer.doubleSpaces.matcher(line).replaceAll(" ");
    final StringBuilder sb = new StringBuilder();
    String segmentedText = "";
    int i;
    final String[] words = line.split(" ");
    // iterate over the words
    for (i = 0; i < words.length - 1; i++) {
      final Matcher nonSegmentedWordMatcher = nonSegmentedWords
          .matcher(words[i]);
      // candidate word to be segmented found:
      if (nonSegmentedWordMatcher.find()) {
        final String curWord = nonSegmentedWordMatcher.replaceAll("$1");
        final String finalPunct = nonSegmentedWordMatcher.replaceAll("$2");
        if (!curWord.isEmpty() && curWord.matches("(" + this.NON_BREAKER + ")")
            && finalPunct.isEmpty()) {
          // if current word is not empty and is a no breaker and there is not
          // final punctuation
        } else if (acronym.matcher(words[i]).find()) {
          // if acronym
        } else if (nextCandidateWord.matcher(words[i + 1]).find()) {
          // if next word contains initial punctuation and then uppercase or
          // digit do:
          if (!(!curWord.isEmpty() && curWord.matches(NON_BREAKER_DIGITS)
              && finalPunct.isEmpty()
              && startDigit.matcher(words[i + 1]).find())) {
            // segment unless current word is a non breaker digit and next word
            // is not final punctuation or does not start with a number
            words[i] = words[i] + "\n";
          }
        }
      }
      sb.append(words[i]).append(" ");
      segmentedText = sb.toString();
    }
    // add last index of words array removed for easy look ahead
    segmentedText = segmentedText + words[i];
    return segmentedText;
  }
640801
public static String[] getDataFromLine(final String line, final String seperator)
	{
		return getDataFromLine(line, seperator, false);
	}
780339
private Value parse(String line) {
        int i = line.indexOf(" : ");
        if (i == -1) {
            throw new IllegalArgumentException("Malformed line in RI Query "
                    + "result (expected ' : ' delimiter): '" + line + "'");
        } else {
            return NTriplesUtil.parseValue(line.substring(i + 3), factory);
        }
    }
611828
public static int findWordEnd(String line, int pos, String noWordSep) {
        return findWordEnd(line, pos, noWordSep, true);
    }
685995
public List<Object> getItemAt(int index) {
        if (index < 0 || index >= totalCount) {
            // Out of range
            return null;
        }

        ensureAvailable(index);
        return data.get(index);
    }
947978
private String[] extractDispositionInfo(String line) throws IOException {
    // Return the line's data as an array: disposition, name, filename
    String[] retval = new String[4];

    // Convert the line to a lowercase string without the ending \r\n
    // Keep the original line for error messages and for variable names.
    String origline = line;
    line = origline.toLowerCase();

    // Get the content disposition, should be "form-data"
    int start = line.indexOf("content-disposition: ");
    int end = line.indexOf(";");
    if (start == -1 || end == -1) {
      throw new IOException("Content disposition corrupt: " + origline);
    }
    String disposition = line.substring(start + 21, end).trim();
    if (!disposition.equals("form-data")) {
      throw new IOException("Invalid content disposition: " + disposition);
    }

    // Get the field name
    start = line.indexOf("name=\"", end);  // start at last semicolon
    end = line.indexOf("\"", start + 7);   // skip name=\"
    int startOffset = 6;
    if (start == -1 || end == -1) {
      // Some browsers like lynx don't surround with ""
      // Thanks to Deon van der Merwe, dvdm@truteq.co.za, for noticing
      start = line.indexOf("name=", end);
      end = line.indexOf(";", start + 6);
      if (start == -1) {
        throw new IOException("Content disposition corrupt: " + origline);
      }
      else if (end == -1) {
        end = line.length();
      }
      startOffset = 5;  // without quotes we have one fewer char to skip
    }
    String name = origline.substring(start + startOffset, end);

    // Get the filename, if given
    String filename = null;
    String origname = null;
    start = line.indexOf("filename=\"", end + 2);  // start after name
    end = line.indexOf("\"", start + 10);          // skip filename=\"
    if (start != -1 && end != -1) {                // note the !=
      filename = origline.substring(start + 10, end);
      origname = filename;
      // The filename may contain a full path.  Cut to just the filename.
      int slash =
        Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\'));
      if (slash > -1) {
        filename = filename.substring(slash + 1);  // past last slash
      }
    }

    // Return a String array: disposition, name, filename
    // empty filename denotes no file posted!
    retval[0] = disposition;
    retval[1] = name;
    retval[2] = filename;
    retval[3] = origname;
    return retval;
  }
1374357
private String trim(String line) {
        char[] chars = line.toCharArray();
        int len = chars.length;

        while (len > 0) {
            if (!Character.isWhitespace(chars[len - 1])) {
                break;
            }
            len--;
        }

        return line.substring(0, len);
    }
653029
def get_all( line )
      retval = nil
      m = /^\s*;\s*all_parts\s*(.+)[^\s]*/.match( line )
      if m && m[1]
        retval = m[1]
      end
      return retval
    end