JML

org.multijava.mjc
Class CFieldTable

java.lang.Object
  extended byorg.multijava.util.Utils
      extended byorg.multijava.mjc.CFieldTable
All Implemented Interfaces:
Cloneable

public class CFieldTable
extends Utils

This class encapsulates the fields of a class.


Field Summary
private  boolean expandable
          Indicates whether additional fields can be added to this field table.
private  Hashtable hashed
           
private static int uniquifier
           
 
Fields inherited from class org.multijava.util.Utils
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO
 
Constructor Summary
CFieldTable(CField[] array, Hashtable hashed)
          Constructs a field table using one of array or hashed.
 
Method Summary
 void add(CSourceField field)
          Adds a field.
 FieldInfo[] buildFieldInfo()
          Returns the field infos
private  Hashtable buildHash(CField[] array)
          Utility methods builds a hash table from the array of fields.
 Collection fields()
          Returns a Collection of CField objects contained in this CFieldTable.
 CField lookup(String ident)
          Returns the field with specified name
 int size()
          Returns the number of fields.
 CSourceField[] sourceFields()
          Returns an array of the CSourceFields stored in this field table.
 
Methods inherited from class org.multijava.util.Utils
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hashed

private Hashtable hashed

expandable

private boolean expandable
Indicates whether additional fields can be added to this field table.


uniquifier

private static int uniquifier
Constructor Detail

CFieldTable

public CFieldTable(CField[] array,
                   Hashtable hashed)
Constructs a field table using one of array or hashed. The other parameter should be null.

Method Detail

buildHash

private Hashtable buildHash(CField[] array)
Utility methods builds a hash table from the array of fields.

requires array != null && 
(\forall int i; 0<=i && i < array.length; 
array[i] instanceof CSourceField );
assignable expandable;
ensures expandable;
also
requires array != null && 
(\exists int i; 0<=i && i < array.length; 
!(array[i] instanceof CSourceField) );
ensures !expandable;
 


lookup

public CField lookup(String ident)
Returns the field with specified name

Parameters:
ident - the simple name of the field

size

public int size()
Returns the number of fields.


fields

public Collection fields()
Returns a Collection of CField objects contained in this CFieldTable.


add

public void add(CSourceField field)
Adds a field.


buildFieldInfo

public FieldInfo[] buildFieldInfo()
Returns the field infos


sourceFields

public CSourceField[] sourceFields()
Returns an array of the CSourceFields stored in this field table. The array returned is empty if this field table is not expandable.


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.