chord.analyses.alias
Class Ctxt

java.lang.Object
  extended by chord.analyses.alias.Ctxt
All Implemented Interfaces:
java.io.Serializable

public class Ctxt
extends java.lang.Object
implements java.io.Serializable

Representation of an abstract context of a method.

Each abstract context is a possibly empty sequence of the form [e1,...,en] where each ei is either an object allocation statement or a method invocation statement in decreasing order of significance.

The abstract context corresponding to the empty sequence, called epsilon, is the lone context of methods that are analyzed context insensitively. These include the main method, all class initializer methods, and any additional user-specified methods (see CtxtsAnalysis).

Author:
Mayur Naik (mhn@cs.stanford.edu)
See Also:
Serialized Form

Constructor Summary
Ctxt(joeq.Compiler.Quad.Quad[] elems)
          Constructor.
 
Method Summary
 Ctxt append(joeq.Compiler.Quad.Quad q)
           
 boolean contains(joeq.Compiler.Quad.Quad inst)
          Determines whether this abstract context contains a given statement.
 int count(joeq.Compiler.Quad.Quad inst)
           
 boolean equals(java.lang.Object o)
           
 joeq.Compiler.Quad.Quad get(int i)
           
 joeq.Compiler.Quad.Quad[] getElems()
          Provides the sequence of statements comprising this abstract context.
 int hashCode()
           
 joeq.Compiler.Quad.Quad head()
           
 joeq.Compiler.Quad.Quad last()
           
 int length()
           
 Ctxt prefix(int k)
           
 Ctxt prepend(joeq.Compiler.Quad.Quad q)
           
 Ctxt prepend(joeq.Compiler.Quad.Quad q, int max)
           
 Ctxt suffix(int k)
           
 Ctxt tail()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ctxt

public Ctxt(joeq.Compiler.Quad.Quad[] elems)
Constructor.

Parameters:
elems - The sequence of statements comprising this abstract context.
Method Detail

getElems

public joeq.Compiler.Quad.Quad[] getElems()
Provides the sequence of statements comprising this abstract context.

Returns:
The sequence of statements comprising this abstract context.

contains

public boolean contains(joeq.Compiler.Quad.Quad inst)
Determines whether this abstract context contains a given statement.

Parameters:
inst - A statement.
Returns:
true iff this abstract context contains the given statement.

count

public int count(joeq.Compiler.Quad.Quad inst)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

length

public int length()

get

public joeq.Compiler.Quad.Quad get(int i)

head

public joeq.Compiler.Quad.Quad head()

last

public joeq.Compiler.Quad.Quad last()

tail

public Ctxt tail()

prefix

public Ctxt prefix(int k)

suffix

public Ctxt suffix(int k)

prepend

public Ctxt prepend(joeq.Compiler.Quad.Quad q)

prepend

public Ctxt prepend(joeq.Compiler.Quad.Quad q,
                    int max)

append

public Ctxt append(joeq.Compiler.Quad.Quad q)