public static int indexInParent (Layer layer) {
    GroupLayer parent = layer.parent();
    if (parent == null) return -1;
    for (int ii = parent.children()-1; ii >= 0; ii--) {
      if (parent.childAt(ii) == layer) return ii;
    }
    throw new AssertionError();
  }
public static int indexInParent ( Layer layer ) { GroupLayer parent = layer . parent ( ) ; if ( parent == null ) return - 1 ; for ( int ii = parent . children ( ) - 1 ; ii >= 0 ; ii -- ) { if ( parent . childAt ( ii ) == layer ) return ii ; } throw new AssertionError ( ) ; }
Returns the index of the given layer within its parent, or -1 if the parent is null.