X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FZsort.java;h=8325f9a5d468ad10cf2a62581ad4c8d92e53bcf7;hb=77c35fa912621cbadcf5ec74da4c6d45de6322e1;hp=322fd2a0466428f306f45a3ee6cb5a6c7aebb304;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/MCview/Zsort.java b/src/MCview/Zsort.java index 322fd2a..8325f9a 100755 --- a/src/MCview/Zsort.java +++ b/src/MCview/Zsort.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,11 +22,11 @@ import java.util.*; public class Zsort { - public static void Zsort(Vector bonds) { + public void Zsort(Vector bonds) { sort(bonds, 0, bonds.size() - 1); } - public static void sort(Vector bonds, int p, int r) { + public void sort(Vector bonds, int p, int r) { int q; if (p < r) { @@ -36,23 +36,23 @@ public class Zsort { } } - private static int partition(Vector bonds, int p, int r) { + private int partition(Vector bonds, int p, int r) { float x = ((Bond) bonds.elementAt(p)).start[2]; int i = p - 1; int j = r + 1; - + Bond tmp; while (true) { do { - j = j - 1; + j --; } while ((j >= 0) && (((Bond) bonds.elementAt(j)).start[2] > x)); do { - i = i + 1; + i ++; } while ((i < bonds.size()) && (((Bond) bonds.elementAt(i)).start[2] < x)); if (i < j) { - Bond tmp = (Bond) bonds.elementAt(i); + tmp = (Bond) bonds.elementAt(i); bonds.setElementAt(bonds.elementAt(j), i); bonds.setElementAt(tmp, j); } else {