001/** 002 * 003 */ 004package org.openimaj.hardware.serial; 005 006 007/** 008 * An interface for objects that can parse serial data. 009 * 010 * @author David Dupplaw (dpd@ecs.soton.ac.uk) 011 * 012 * @created 12 Jul 2011 013 */ 014public interface SerialDataParser 015{ 016 /** 017 * Called to parse the raw data into tokens or sentences. 018 * 019 * @param data The raw data. 020 * @return A list of tokens/sentences 021 */ 022 public String[] parse( String data ); 023 024 /** 025 * This function must return the data that was left-over 026 * from the previous parse, if at all. May return null. 027 * 028 * @return The left-over parts of the string after parsing. 029 */ 030 public String getLeftOverString(); 031}