Generic Interpreter 1.3
Private API

gi
Class Lexicon.Set<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<E>
              extended by java.util.Stack<E>
                  extended by gi.Lexicon.Set<E>
Type Parameters:
E - the element type.
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess
Direct Known Subclasses:
LR0_Grammar.Set
Enclosing class:
Lexicon

static class Lexicon.Set<E>
extends Stack<E>

This class implements a Set.

Version:
1.3
Author:
© 1999-2009 Craig A. Rich <carich@csupomona.edu>

Field Summary
private  boolean excludeNull
          The null exclusion indicator.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Lexicon.Set(int capacity)
          Constructs a Set with an initial capacity.
 
Method Summary
 boolean add(E element)
          Adds an element to this Set.
(package private)  boolean add(int index, Lexicon.Set<E> S)
          Adds a Set of elements to this Set.
(package private)  boolean add(Lexicon.Set<E> S)
          Adds a Set of elements to this Set.
 String toString()
           
 
Methods inherited from class java.util.Stack
empty, peek, pop, push, search
 
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

excludeNull

private final boolean excludeNull

The null exclusion indicator. If true, add methods will not add null to this Set.

Constructor Detail

Lexicon.Set

Lexicon.Set(int capacity)

Constructs a Set with an initial capacity.

Parameters:
capacity - the initial capacity. The magnitude of capacity is the initial capacity. The null exclusion indicator is initialized to true if capacity is negative.
Method Detail

add

public boolean add(E element)

Adds an element to this Set. The element is not added if it occurs in this Set or it is null and the null exclusion indicator is true. The capacity is expanded if necessary.

Specified by:
add in interface Collection<E>
Specified by:
add in interface List<E>
Overrides:
add in class Vector<E>
Parameters:
element - the element to add to this Set.
Returns:
true if this Set is changed; false otherwise.

add

boolean add(int index,
            Lexicon.Set<E> S)

Adds a Set of elements to this Set. An element is not added if it occurs in this Set or it is null and the null exclusion indicator is true. The capacity is expanded if necessary.

Parameters:
index - the index in S beyond which elements are added.
S - the Set to add to this Set.
Returns:
true if this Set is changed; false otherwise.

add

boolean add(Lexicon.Set<E> S)

Adds a Set of elements to this Set. An element is not added if it occurs in this Set or it is null and the null exclusion indicator is true. The capacity is expanded if necessary.

Parameters:
S - the Set to add to this Set.
Returns:
true if this Set is changed; false otherwise.

toString

public String toString()
Overrides:
toString in class Vector<E>

 

© 1999-2009 Craig A. Rich <carich@csupomona.edu>