Generic Interpreter 1.2
Private API

gi
Class Lexicon.Set

java.lang.Object
  extended bygi.Lexicon.Stack
      extended bygi.Lexicon.Set
Direct Known Subclasses:
LR0_Grammar.Contexts
Enclosing class:
Lexicon

static class Lexicon.Set
extends Lexicon.Stack

This class implements a Set.

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

Field Summary
private  boolean excludeNull
          The null exclusion indicator.
(package private)  Object[] get
          The objects on this Stack.
(package private)  int size
          The number of objects on this Stack.
 
Constructor Summary
(package private) Lexicon.Set(int capacity)
          Constructs a Set with an initial capacity.
 
Method Summary
(package private)  boolean add(Lexicon.Set S)
          Adds a Set of objects to this Set.
(package private)  boolean add(Lexicon.Set S, int start)
          Adds a Set of objects to this Set.
(package private)  boolean add(Object object)
          Adds an object to this Set.
(package private)  boolean contains(Object object)
          Indicates whether an object occurs in this Set.
(package private)  Object pop()
          Pops and returns the top object of this Stack.
(package private)  boolean push(Object object)
          Pushes an object onto this Stack.
(package private)  Object top()
          Returns the top object of this Stack.
 String toString()
          Returns the string representation of this Stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

excludeNull

private final boolean excludeNull

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


get

Object[] get

The objects on this Stack.


size

int size

The number of objects on this Stack.

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

boolean add(Lexicon.Set S)

Adds a Set of objects to this Set. An object 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.

add

boolean add(Lexicon.Set S,
            int start)

Adds a Set of objects to this Set. An object 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.
start - the index in S beyond which objects are added.
Returns:
true if this Set is changed; false otherwise.

add

boolean add(Object object)

Adds an object to this Set. The object 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:
object - the object to add to this Set.
Returns:
true if this Set is changed; false otherwise.

contains

boolean contains(Object object)

Indicates whether an object occurs in this Set.

Parameters:
object - the object whose membership if requested.
Returns:
true if o occurs in this Set; false otherwise.

pop

Object pop()

Pops and returns the top object of this Stack.

Returns:
the top object of this Stack.

push

boolean push(Object object)

Pushes an object onto this Stack. The capacity is expanded by 50% if necessary.

Parameters:
object - the object to push onto this Stack.
Returns:
true indicates this Stack is changed.

top

Object top()

Returns the top object of this Stack.

Returns:
the top object of this Stack.

toString

public String toString()

Returns the string representation of this Stack.

Returns:
the string representation of this Stack.

 

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