src/main/java/org/thegalactic/lattice/ClosureSystem.java
public Concept nextClosure(Concept cl) {
        TreeSet<Comparable> set = new TreeSet(this.getSet());
        boolean success = false;
        TreeSet setA = new TreeSet(cl.getSetA());
        Comparable ni = set.last();
        do {
            ni = (Comparable) set.last();
            set.remove(ni);
            if (!setA.contains(ni)) {
                setA.add(ni);
                TreeSet setB = this.closure(setA);
                setB.removeAll(setA);
                if (setB.isEmpty() || ((Comparable) setB.first()).compareTo(ni) >= 1) {
                    setA = this.closure(setA);
                    success = true;
                } else {
                    setA.remove(ni);
                }
            } else {
                setA.remove(ni);
            }
        } while (!success && ni.compareTo(this.getSet().first()) >= 1);
        return new Concept(setA, false);
    }
/**
     * Returns the lecticaly next closed set of the specified one.
     *
     * This treatment is an implementation of the best knowm algorithm of Wille
     * whose complexity is in O(Cl|S|^2), where S is the initial set of
     * elements, and Cl is the closure computation complexity.
     *
     * @param cl a concept
     *
     * @return the lecticaly next closed set
     */
Returns the lecticaly next closed set of the specified one.
This treatment is an implementation of the best knowm algorithm of Wille
whose complexity is in O(Cl|S|^2), where S is the initial set of
elements, and Cl is the closure computation complexity.

@param cl a concept

@return the lecticaly next closed set
Returns the lecticaly next closed set of the specified one . This treatment is an implementation of the best knowm algorithm of Wille whose complexity is in O ( Cl|S|^2 ) where S is the initial set of elements and Cl is the closure computation complexity . @param cl a concept @return the lecticaly next closed set
public Concept nextClosure(Concept cl) {
        TreeSet<Comparable> set = new TreeSet(this.getSet());
        boolean success = false;
        TreeSet setA = new TreeSet(cl.getSetA());
        Comparable ni = set.last();
        do {
            ni = (Comparable) set.last();
            set.remove(ni);
            if (!setA.contains(ni)) {
                setA.add(ni);
                TreeSet setB = this.closure(setA);
                setB.removeAll(setA);
                if (setB.isEmpty() || ((Comparable) setB.first()).compareTo(ni) >= 1) {
                    setA = this.closure(setA);
                    success = true;
                } else {
                    setA.remove(ni);
                }
            } else {
                setA.remove(ni);
            }
        } while (!success && ni.compareTo(this.getSet().first()) >= 1);
        return new Concept(setA, false);
    }
public Concept nextClosure ( Concept cl ) { TreeSet < Comparable > set = new TreeSet ( this . getSet ( ) ) ; boolean success = false ; TreeSet setA = new TreeSet ( cl . getSetA ( ) ) ; Comparable ni = set . last ( ) ; do { ni = ( Comparable ) set . last ( ) ; set . remove ( ni ) ; if ( ! setA . contains ( ni ) ) { setA . add ( ni ) ; TreeSet setB = this . closure ( setA ) ; setB . removeAll ( setA ) ; if ( setB . isEmpty ( ) || ( ( Comparable ) setB . first ( ) ) . compareTo ( ni ) >= 1 ) { setA = this . closure ( setA ) ; success = true ; } else { setA . remove ( ni ) ; } } else { setA . remove ( ni ) ; } } while ( ! success && ni . compareTo ( this . getSet ( ) . first ( ) ) >= 1 ) ; return new Concept ( setA , false ) ; }
Returns the lecticaly next closed set of the specified one.
Returns the lecticaly next closed set of the specified one .