Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.flow
Class SlotSet

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
          extended bynet.sf.jode.flow.SlotSet
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.Set

public final class SlotSet
extends java.util.AbstractSet
implements java.lang.Cloneable

This class represents a set of local info, all having different slots. It is used for representing the in sets of flow block.

Its add method will automatically merge any localinfo that have the same slot and is in the method.


Constructor Summary
SlotSet()
          Creates a new empty variable set
SlotSet(LocalInfo[] locals)
          Creates a new pre initialized variable set
 
Method Summary
 boolean add(java.lang.Object o)
          Adds a local info to this variable set.
 void clear()
          Removes everything from this variable set.
 java.lang.Object clone()
           
 boolean contains(java.lang.Object o)
           
 boolean containsSlot(int slot)
          Checks if the variable set contains a local with the given name.
 LocalInfo findSlot(int slot)
          Checks if the variable set contains a local with the given slot.
 void grow(int size)
           
 java.util.Iterator iterator()
           
 void merge(VariableSet vs)
          Merges this SlotSet with another.
 void mergeKill(LocalInfo li)
          Add the slots in kill to the current set, unless there are already in this set.
 void mergeKill(java.util.Set kill)
          Add the slots in kill to the current set, unless there are already in this set.
 boolean remove(java.lang.Object li)
          Removes a slot from this variable set.
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, isEmpty, retainAll, toArray, toArray
 

Constructor Detail

SlotSet

public SlotSet()
Creates a new empty variable set


SlotSet

public SlotSet(LocalInfo[] locals)
Creates a new pre initialized variable set

Method Detail

grow

public final void grow(int size)

add

public boolean add(java.lang.Object o)
Adds a local info to this variable set.

Specified by:
add in interface java.util.Set

contains

public final boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Set

containsSlot

public final boolean containsSlot(int slot)
Checks if the variable set contains a local with the given name.


findSlot

public LocalInfo findSlot(int slot)
Checks if the variable set contains a local with the given slot.


remove

public boolean remove(java.lang.Object li)
Removes a slot from this variable set.

Specified by:
remove in interface java.util.Set

size

public int size()
Specified by:
size in interface java.util.Set

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Set

clear

public void clear()
Removes everything from this variable set.

Specified by:
clear in interface java.util.Set

clone

public java.lang.Object clone()

merge

public void merge(VariableSet vs)
Merges this SlotSet with another. For all slots occuring in both variable sets, all corresponding LocalInfos are merged. The sets are not changed (use addAll for this).

Parameters:
vs - the other variable set.
Returns:
The merged variables.

mergeKill

public void mergeKill(LocalInfo li)
Add the slots in kill to the current set, unless there are already in this set. This differs from addAll, in the fact that it doesn't combine the locals.


mergeKill

public void mergeKill(java.util.Set kill)
Add the slots in kill to the current set, unless there are already in this set. This differs from addAll, in the fact that it doesn't combine the locals.

Parameters:
kill - The other kill set.

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.