JML

org.jmlspecs.checker
Class CParseClassContext

java.lang.Object
  extended byorg.multijava.mjc.CParseClassContext
      extended byorg.jmlspecs.checker.CParseClassContext

public class CParseClassContext
extends CParseClassContext

This class is used by the parser to collect the members of a class declaration. For efficiency (and to avoid memory leaks caused by poor garbage collection in the JVM) a factory method is used to generate instances and old instances are store on a stack for reuse. It has the same name as its superclass since ANTLR's textual grammar inheritance will then refer to the right (package-local) class.


Field Summary
private  ArrayList axioms
          A ArrayList of JmlAxiom instance parsed in the class declaration buffered by this.
private  ArrayList constraints
          A ArrayList of JmlConstraint instance parsed in the class declaration buffered by this.
private  ArrayList invariants
          A ArrayList of JmlInvariant instance parsed in the class declaration buffered by this.
private  ArrayList representsDecls
          A ArrayList of JmlRepresentsDecl instance parsed in the class declaration buffered by this.
private static Stack stack
           
private  ArrayList varAssertions
          A ArrayList of JmlVarAssertion instance parsed in the class declaration buffered by this.
 
Fields inherited from class org.multijava.mjc.CParseClassContext
 
Constructor Summary
protected CParseClassContext()
          Hides the default constructor.
 
Method Summary
 void addAxiom(JmlAxiom inv)
           
 void addConstraint(JmlConstraint inv)
           
 void addInvariant(JmlInvariant inv)
           
 void addRepresentsDecl(JmlRepresentsDecl inv)
           
 void addVarAssertion(JmlVarAssertion varAssert)
           
 JmlAxiom[] axioms()
           
protected  void clear()
          Prepares this instance for recycling by clearing all the data stored in its ArrayLists.
 JmlConstraint[] constraints()
           
static CParseClassContext getInstance()
          Factory method returns an instance of CParseJmlClassContext.
 JmlInvariant[] invariants()
           
 void release()
          Calls the static method release(this)
static void release(CParseClassContext context)
          Erases the data stored in context and pushes the instance onto a stack for recycling.
 JmlRepresentsDecl[] representsDecls()
           
 JmlVarAssertion[] varAssertions()
           
 
Methods inherited from class org.multijava.mjc.CParseClassContext
addBlockInitializer, addFieldDeclaration, addInnerDeclaration, addMethodDeclaration, getFieldsAndInits, getInnerClasses, getMethods, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invariants

private ArrayList invariants
A ArrayList of JmlInvariant instance parsed in the class declaration buffered by this.


constraints

private ArrayList constraints
A ArrayList of JmlConstraint instance parsed in the class declaration buffered by this.


representsDecls

private ArrayList representsDecls
A ArrayList of JmlRepresentsDecl instance parsed in the class declaration buffered by this.


axioms

private ArrayList axioms
A ArrayList of JmlAxiom instance parsed in the class declaration buffered by this.


varAssertions

private ArrayList varAssertions
A ArrayList of JmlVarAssertion instance parsed in the class declaration buffered by this.


stack

private static Stack stack
Constructor Detail

CParseClassContext

protected CParseClassContext()
Hides the default constructor.

Method Detail

getInstance

public static CParseClassContext getInstance()
Factory method returns an instance of CParseJmlClassContext. The instance is recycled from the stack of discarded instances or a new instance is minted if the stack is empty.

Returns:
a fresh CParseClassContext instance

release

public void release()
Calls the static method release(this)

Overrides:
release in class CParseClassContext

release

public static void release(CParseClassContext context)
Erases the data stored in context and pushes the instance onto a stack for recycling.

Parameters:
context - a used instance to be recycled

clear

protected void clear()
Prepares this instance for recycling by clearing all the data stored in its ArrayLists.

Overrides:
clear in class CParseClassContext

addInvariant

public void addInvariant(JmlInvariant inv)

invariants

public JmlInvariant[] invariants()

addConstraint

public void addConstraint(JmlConstraint inv)

constraints

public JmlConstraint[] constraints()

addRepresentsDecl

public void addRepresentsDecl(JmlRepresentsDecl inv)

representsDecls

public JmlRepresentsDecl[] representsDecls()

addAxiom

public void addAxiom(JmlAxiom inv)

axioms

public JmlAxiom[] axioms()

addVarAssertion

public void addVarAssertion(JmlVarAssertion varAssert)

varAssertions

public JmlVarAssertion[] varAssertions()

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.