dk.brics.xact.analysis.flowgraph
Class VariableFilter

java.lang.Object
  extended by dk.brics.xact.analysis.flowgraph.VariableFilter

public class VariableFilter
extends Object

Variable label set for flow graph edges.


Nested Class Summary
static class VariableFilter.Kind
          Variable filter kinds.
 
Constructor Summary
VariableFilter()
          Constructs a normal variable label set, initially containing all variables.
VariableFilter(boolean reversed)
          Constructs a normal variable label set.
VariableFilter(boolean reversed, VariableFilter.Kind kind)
          Constructs a variable label set with a specific kind.
VariableFilter(boolean reversed, VariableFilter.Kind kind, int id)
          Constructs a variable label set with a specific kind and call id.
VariableFilter(Variable v)
          Constructs a normal variable label set, initially containing a single variable.
VariableFilter(Variable v, VariableFilter.Kind kind)
          Constructs a normal variable label set, initially containing a single variable.
 
Method Summary
 void addVariable(Variable var)
          Adds a variable to the label set.
 boolean containsAll()
          Returns true if this definitely contains all variables.
 boolean containsVariable(Variable var)
          Checks whether the given variable is contained in the label set.
 boolean equals(Object other)
          Checks whether the given variable filter is equal to this variable filter.
 VariableFilter.Kind getKind()
          Returns the edge kind.
 Set<Variable> getVariableSet()
          For reversed filters, returns the set of variables not in the filter, and for non-reversed filters, returns the set of variables in the filter.
 int hashCode()
          Returns a hash code for this variable filter.
 VariableFilter intersection(VariableFilter other)
          Creates a new variable filter accepting only variables accepted by both variable filters.
 boolean isReversed()
           
 void removeVariable(Variable var)
          Removes a variable from the label set.
 String toString()
          Returns a string description of this variable filter.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableFilter

public VariableFilter()
Constructs a normal variable label set, initially containing all variables.


VariableFilter

public VariableFilter(boolean reversed)
Constructs a normal variable label set.

Parameters:
reversed - indicates whether the set should initially contain all variables (true) or no variables (false).

VariableFilter

public VariableFilter(boolean reversed,
                      VariableFilter.Kind kind)
Constructs a variable label set with a specific kind.

Parameters:
reversed - indicates whether the set should initially contain all variables (true) or no variables (false).
kind - the kind of edge to make

VariableFilter

public VariableFilter(boolean reversed,
                      VariableFilter.Kind kind,
                      int id)
Constructs a variable label set with a specific kind and call id.

Parameters:
reversed - indicates whether the set should initially contain all variables (true) or no variables (false).
kind - the kind of edge to make
id - the call ID of the edge

VariableFilter

public VariableFilter(Variable v)
Constructs a normal variable label set, initially containing a single variable.


VariableFilter

public VariableFilter(Variable v,
                      VariableFilter.Kind kind)
Constructs a normal variable label set, initially containing a single variable.

Method Detail

addVariable

public void addVariable(Variable var)
Adds a variable to the label set. Ignored for reversed filters.


containsAll

public boolean containsAll()
Returns true if this definitely contains all variables. A non-reversed variable filter always returns false regardless of the number of variables added to it.


containsVariable

public boolean containsVariable(Variable var)
Checks whether the given variable is contained in the label set.


equals

public boolean equals(Object other)
Checks whether the given variable filter is equal to this variable filter.

Overrides:
equals in class Object

getKind

public VariableFilter.Kind getKind()
Returns the edge kind.


getVariableSet

public Set<Variable> getVariableSet()
For reversed filters, returns the set of variables not in the filter, and for non-reversed filters, returns the set of variables in the filter.


hashCode

public int hashCode()
Returns a hash code for this variable filter.

Overrides:
hashCode in class Object

intersection

public VariableFilter intersection(VariableFilter other)
Creates a new variable filter accepting only variables accepted by both variable filters. The input variable filters are unmodified. The resulting variable filter's kind will always be set to NORMAL.

Parameters:
other - a variable filter. Will not be modified
Returns:
a new variable filter instance

isReversed

public boolean isReversed()

removeVariable

public void removeVariable(Variable var)
Removes a variable from the label set. Ignored for non-reversed filters.


toString

public String toString()
Returns a string description of this variable filter.

Overrides:
toString in class Object


Copyright © 2005-2011 Aarhus University.