Java TreeSet getDockInsets(final TreeSet set)

Here you can find the source of getDockInsets(final TreeSet set)

Description

get Dock Insets

License

Open Source License

Declaration

private static int getDockInsets(final TreeSet<Integer> set) 

Method Source Code

//package com.java2s;

import java.util.TreeSet;

public class Main {
    /**//from   w ww .  jav  a  2 s .c  o  m
     * This is the maximum grid position for "normal" components. Docking components use the space out to
     * <code>MAX_DOCK_GRID</code> and below 0.
     */
    private static final int MAX_GRID = 30000;

    private static int getDockInsets(final TreeSet<Integer> set) {
        int c = 0;
        for (final Integer i : set) {
            if (i < -MAX_GRID) {
                c++;
            } else {
                break; // Since they are sorted we can break
            }
        }
        return c;
    }
}

Related

  1. concatenate(TreeSet in)
  2. convertSpanToSparseGrid(final int curIx, final int span, final TreeSet indexes)
  3. createTreeSet(Iterable c)
  4. cvtListToTreeSet(List list)
  5. findSizedSubdirs(final String size, final TreeSet themeSubdirs)
  6. getTreeSet(Collection collection)
  7. getTreeSet(final Object o, final Class classElement)
  8. getVariance(TreeSet positions)
  9. intersection(TreeSet AL1, TreeSet AL2)