com.puppycrawl.tools.checkstyle.api

Class Scope

public final class Scope extends Object implements Comparable, Serializable

Represents a Java visibility scope.

Author: Lars Kühne

Field Summary
static ScopeANONINNER
anon inner scope.
static ScopeNOTHING
nothing scope.
static ScopePACKAGE
package scope.
static ScopePRIVATE
private scope.
static ScopePROTECTED
protected scope.
static ScopePUBLIC
public scope.
Method Summary
intcompareTo(Object aObject)
{@inheritDoc}
static ScopegetInstance(String aScopeName)
Scope factory method.
StringgetName()
booleanisIn(Scope aScope)
Checks if this scope is a subscope of another scope.
StringtoString()
{@inheritDoc}

Field Detail

ANONINNER

public static final Scope ANONINNER
anon inner scope.

NOTHING

public static final Scope NOTHING
nothing scope.

PACKAGE

public static final Scope PACKAGE
package scope.

PRIVATE

public static final Scope PRIVATE
private scope.

PROTECTED

public static final Scope PROTECTED
protected scope.

PUBLIC

public static final Scope PUBLIC
public scope.

Method Detail

compareTo

public int compareTo(Object aObject)
{@inheritDoc}

getInstance

public static Scope getInstance(String aScopeName)
Scope factory method.

Parameters: aScopeName scope name, such as "nothing", "public", etc.

Returns: the Scope associated with aScopeName

getName

public String getName()

Returns: the name of this scope.

isIn

public boolean isIn(Scope aScope)
Checks if this scope is a subscope of another scope. Example: PUBLIC is a subscope of PRIVATE.

Parameters: aScope a Scope value

Returns: if this is a subscope of aScope.

toString

public String toString()
{@inheritDoc}