JML

org.multijava.mjc
Interface CMemberHost

All Known Implementing Classes:
CClass, CCompilationUnit

public interface CMemberHost

This interface is implementation by abstractions that can host members. It provides operations for testing the permissibility of access to the hosted members.


Method Summary
 boolean descendsFrom(CClass maybeSuper)
          Indicates whether this host is a subclass of the given class, where "subclass" is the reflexive, transitive closure of the extends relation.
 CMemberHost host()
          Returns the host of this host, that is, the context in which this host is declared.
 String ident()
          Gives the identifier for this host, or null for a compilation unit.
 boolean isAccessibleFrom(CMemberHost from)
          Indicates whether this is accessible from the given host.
 boolean isClass()
          Indicates whether this host is a class.
 boolean isCompilationUnit()
          Indicates whether this host is a compilation unit
 boolean isDefinedInside(CMemberHost maybeOutside)
          Indicates whether this is defined inside the given host.
 boolean isInnerClass()
          Indicates whether this host is an inner class, i.e., a non-static member class.
 boolean isNestedType()
          Indicates whether this host is a nested type, i.e., a member type, a type declared within another type.
 boolean nestedDescendsFrom(CClass maybeOuterSuper)
          Returns true if this host is a subclass of the given class or if some host of this host is a subclass of the given class.
 String packageName()
          Gives the package name for this host.
 

Method Detail

isAccessibleFrom

public boolean isAccessibleFrom(CMemberHost from)
Indicates whether this is accessible from the given host.

Parameters:
from - the host that wants access
Returns:
true iff the given host is allowed access to this host's members

isDefinedInside

public boolean isDefinedInside(CMemberHost maybeOutside)
Indicates whether this is defined inside the given host.

Parameters:
maybeOutside - the host that this may be inside
Returns:
true if the given host is a (possibly transitive) host of this

descendsFrom

public boolean descendsFrom(CClass maybeSuper)
Indicates whether this host is a subclass of the given class, where "subclass" is the reflexive, transitive closure of the extends relation.

Parameters:
maybeSuper - the potential superclass

nestedDescendsFrom

public boolean nestedDescendsFrom(CClass maybeOuterSuper)
Returns true if this host is a subclass of the given class or if some host of this host is a subclass of the given class.

Parameters:
maybeOuterSuper - the potential superclass

isClass

public boolean isClass()
Indicates whether this host is a class.

Returns:
true iff this host represents a class

isNestedType

public boolean isNestedType()
Indicates whether this host is a nested type, i.e., a member type, a type declared within another type.


isInnerClass

public boolean isInnerClass()
Indicates whether this host is an inner class, i.e., a non-static member class.


isCompilationUnit

public boolean isCompilationUnit()
Indicates whether this host is a compilation unit

Returns:
true iff this host represents a compilation unit

ident

public String ident()
Gives the identifier for this host, or null for a compilation unit.


packageName

public String packageName()
Gives the package name for this host.


host

public CMemberHost host()
Returns the host of this host, that is, the context in which this host is declared. This value is null except for inner classes.

Returns:
the host of this host

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.