org.uacalc.alg.sublat
Class BasicSet

java.lang.Object
  extended by org.uacalc.util.IntArray
      extended by org.uacalc.alg.sublat.BasicSet
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class BasicSet
extends IntArray
implements java.lang.Comparable

This class implement the basic set operations on the set {0, 1, ..., n-1}.

Version:
$Id: BasicSet.java,v 1.6 2009/07/23 01:24:18 ralphfreese Exp $
Author:
Ralph Freese

Field Summary
static BasicSet EMPTY_SET
           
 
Fields inherited from class org.uacalc.util.IntArray
array, size
 
Constructor Summary
BasicSet(int[] set)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          The order of a linear extension respecting rank.
 boolean contains(int i)
           
 boolean leq(BasicSet set2)
          Is this a subset of set2.
static boolean leq(int[] u, int[] v)
          Is u a subset of v.
 void normalize()
          Put the array in ascending order.
 BasicSet setDifference(BasicSet set2)
          Set difference of this and set2.
 java.lang.String toString(SmallAlgebra alg)
          Print this subset using alg's elements.
 
Methods inherited from class org.uacalc.util.IntArray
clone, equalIntArrays, equals, get, getArray, hashCode, intArrayToString, isIdempotent, lexicographicComparitor, satisfiesConstraint, satisfiesConstraint, set, setIntArray, toArray, toString, universeSize
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_SET

public static final BasicSet EMPTY_SET
Constructor Detail

BasicSet

public BasicSet(int[] set)
Method Detail

normalize

public void normalize()
Put the array in ascending order. This modifies this.array.


compareTo

public int compareTo(java.lang.Object o)
The order of a linear extension respecting rank. It first uses size and then lexicographic order.

Specified by:
compareTo in interface java.lang.Comparable

leq

public boolean leq(BasicSet set2)
Is this a subset of set2. Both are assumed to be sorted.


leq

public static boolean leq(int[] u,
                          int[] v)
Is u a subset of v. Both are assumed to be sorted.


contains

public boolean contains(int i)

setDifference

public BasicSet setDifference(BasicSet set2)
Set difference of this and set2.


toString

public java.lang.String toString(SmallAlgebra alg)
Print this subset using alg's elements.



Copyright 2003 Ralph Freese. All Rights Reserved.