* Comments in MEGA are within [ ] brackets, and may be nested.
*
* @return
- * @throws IOException
+ * @throws FileFormatException
*/
- protected String nextNonCommentLine() throws IOException
+ protected String nextNonCommentLine() throws FileFormatException
{
return nextNonCommentLine(0);
}
* @param depth
* current depth of nesting of comments while parsing
* @return
- * @throws IOException
+ * @throws FileFormatException
*/
- protected String nextNonCommentLine(final int depth) throws IOException
+ protected String nextNonCommentLine(final int depth)
+ throws FileFormatException
{
String data = null;
- data = nextLine();
+ try
+ {
+ data = nextLine();
+ } catch (IOException e)
+ {
+ throw new FileFormatException(e.getMessage());
+ }
if (data == null)
{
if (depth > 0)
*
* @param dataLine
* @return
- * @throws IOException
+ * @throws FileFormatException
*/
protected String parseDataLine(String dataLine)
- throws IOException
+ throws FileFormatException
{
String seqId = getSequenceId(dataLine);
if (seqId == null)
* a new one if we haven't seen it before.
*
* @param dataLine
- * @throws IOException
+ * @throws FileFormatException
*/
protected void parseNoninterleavedDataLine(String dataLine)
throws FileFormatException
* Save as alignment properties in case useful.
*
* @return the next non-blank line following the header lines.
- * @throws IOException
+ * @throws FileFormatException
*/
- protected String parseHeaderLines() throws IOException
+ protected String parseHeaderLines() throws FileFormatException
{
String inputLine = null;
while ((inputLine = nextNonCommentLine()) != null)
* semicolon.
*
* @param inputLine
- * @throws IOException
+ * @throws FileFormatException
*/
- protected void parseFormat(String inputLine) throws IOException
+ protected void parseFormat(String inputLine) throws FileFormatException
{
while (inputLine != null)
{
* Reads lines until terminated by semicolon, appending each to the
* Description property value.
*
- * @throws IOException
+ * @throws FileFormatException
*/
protected void parseDescription(String firstDescriptionLine)
- throws IOException
+ throws FileFormatException
{
StringBuilder desc = new StringBuilder(256);
desc.append(getValue(firstDescriptionLine));
*
* @param isIt
* @param dataLine
- * @throws IOException
+ * @throws FileFormatException
*/
protected void assertInterleaved(boolean isIt, String dataLine)
throws FileFormatException