int layer = getLayer (c); int[] range = layerToRange(new Integer(layer)); int top = range[0]; int bot = range[1]; Component[] comps = getComponents (); for (int i = top; i < bot; ++i)
int pos = -1; int index = getIndexOf(c); Component[] components = getComponents(); int layer = getLayer(c); if (index >= 0)
  public int getPosition(Component c)  {    int layer = getLayer (c);    int[] range = layerToRange(new Integer(layer));    int top = range[0];    int bot = range[1];    Component[] comps = getComponents ();    for (int i = top; i < bot; ++i)	    {        if (comps[i] == c)          return i - top;	    }    // should have found it    throw new IllegalArgumentException ();  }