/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
package jalview.analysis;
+import jalview.analysis.SecStrConsensus.SimpleBP;
+import jalview.datamodel.SequenceFeature;
+import jalview.util.MessageManager;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Stack;
import java.util.Vector;
-import jalview.analysis.SecStrConsensus.SimpleBP;
-import jalview.datamodel.SequenceFeature;
-
public class Rna
{
{
for (int i = 0; i < openingPars.length; i++)
{
- System.out.println(closingPars[i] + "->" + openingPars[i]);
+ // System.out.println(closingPars[i] + "->" + openingPars[i]);
put(closingPars[i], openingPars[i]);
}
}
{
if (!isClosingParenthesis(closingParenthesis))
{
- throw new WUSSParseException(
- "Querying matching opening parenthesis for non-closing parenthesis character "
- + closingParenthesis, -1);
+ throw new WUSSParseException(MessageManager.formatMessage("exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis", new String[]{new StringBuffer(closingParenthesis).toString()}), -1);
}
return closingToOpening.get(closingParenthesis);
public static Vector<SimpleBP> GetSimpleBPs(CharSequence line)
throws WUSSParseException
{
- System.out.println(line);
Hashtable<Character, Stack<Integer>> stacks = new Hashtable<Character, Stack<Integer>>();
Vector<SimpleBP> pairs = new Vector<SimpleBP>();
int i = 0;
if (!stacks.containsKey(opening))
{
- throw new WUSSParseException(
- "Mismatched (unseen) closing character " + base, i);
+ throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_unseen_closing_char", new String[]{new StringBuffer(base).toString()}), i);
}
Stack<Integer> stack = stacks.get(opening);
if (stack.isEmpty())
{
// error whilst parsing i'th position. pass back
- throw new WUSSParseException("Mismatched closing character "
- + base, i);
+ throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_closing_char", new String[]{new StringBuffer(base).toString()}), i);
}
int temp = stack.pop();
Stack<Integer> stack = stacks.get(opening);
if (!stack.empty())
{
- throw new WUSSParseException("Mismatched opening character "
- + opening + " at " + stack.pop(), i);
+ throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_opening_char", new String[]{new StringBuffer(opening).toString(),Integer.valueOf(stack.pop()).toString()}), i);
}
}
return pairs;