1 module antlr.v4.runtime.misc.IntSet; 2 3 // Interface IntSet 4 /** 5 * TODO add interface description 6 */ 7 interface IntSet 8 { 9 10 /** 11 * @uml 12 * Adds the specified value to the current set. 13 * 14 * @param el the value to add 15 * 16 * @exception IllegalStateException if the current set is read-only 17 */ 18 public void add(int el); 19 20 /** 21 * @uml 22 * Modify the current {@link IntSet} object to contain all elements that are 23 * present in itself, the specified {@code set}, or both. 24 * 25 * @param set The set to add to the current set. A {@code null} argument is 26 * treated as though it were an empty set. 27 * @return {@code this} (to support chained calls) 28 * 29 * @exception IllegalStateException if the current set is read-only 30 */ 31 public IntSet addAll(IntSet set); 32 33 /** 34 * @uml 35 * Return a new {@link IntSet} object containing all elements that are 36 * present in both the current set and the specified set {@code a}. 37 * 38 * @param a The set to intersect with the current set. A {@code null} 39 * argument is treated as though it were an empty set. 40 * @return A new {@link IntSet} instance containing the intersection of the 41 * current set and {@code a}. The value {@code null} may be returned in 42 * place of an empty result set. 43 */ 44 public IntSet and(IntSet a); 45 46 public IntSet complement(IntSet elements); 47 48 public IntSet or(IntSet a); 49 50 public IntSet subtract(IntSet a); 51 52 private int size(); 53 54 public bool isNil(); 55 56 public bool opEquals(Object obj); 57 58 public int getSingleElement(); 59 60 public bool contains(int el); 61 62 public void remove(int el); 63 64 public int[] toList(); 65 66 public string toString(); 67 68 }