- sortByFeature(featureLabel==null ? null : new String[] {featureLabel},
- groupLabel==null ? null : new String[] {groupLabel}, start, stop, alignment, method);
- }
- private static boolean containsIgnoreCase(final String lab, final String[] labs)
- {
- if (labs==null)
- {
- return true;
- }
- if (lab==null)
- {
- return false;
- }
- for (int q=0;q<labs.length;q++)
- {
- if (labs[q]!=null && lab.equalsIgnoreCase(labs[q]))
- {
- return true;
- }
- }
- return false;
- }
- public static void sortByFeature(String[] featureLabels, String[] groupLabels, int start, int stop,
- AlignmentI alignment, String method)
- {
- if (method!=FEATURE_SCORE && method!=FEATURE_LABEL && method!=FEATURE_DENSITY)
- {
- throw new Error("Implementation Error - sortByFeature method must be one of FEATURE_SCORE, FEATURE_LABEL or FEATURE_DENSITY.");
- }
- boolean ignoreScore=method!=FEATURE_SCORE;
- StringBuffer scoreLabel = new StringBuffer();
- scoreLabel.append(start+stop+method);
- // This doesn't work yet - we'd like to have a canonical ordering that can be preserved from call to call
- for (int i=0;featureLabels!=null && i<featureLabels.length; i++)
- {
- scoreLabel.append(featureLabels[i]==null ? "null" : featureLabels[i]);
- }
- for (int i=0;groupLabels!=null && i<groupLabels.length; i++)