com.puppycrawl.tools.checkstyle.api

Class Scope

Implemented Interfaces:
Comparable, Serializable

public final class Scope
extends java.lang.Object
implements Comparable, Serializable

Represents a Java visibility scope.

Author:
Lars K?hne

Field Summary

static Scope
ANONINNER
anon inner scope.
static Scope
NOTHING
nothing scope.
static Scope
PACKAGE
package scope.
static Scope
PRIVATE
private scope.
static Scope
PROTECTED
protected scope.
static Scope
PUBLIC
public scope.

Method Summary

int
compareTo(Object aObject)
static Scope
getInstance(String aScopeName)
Scope factory method.
String
getName()
boolean
isIn(Scope aScope)
Checks if this scope is a subscope of another scope.
String
toString()

Field Details

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 Details

compareTo

public int compareTo(Object aObject)

See Also:
Comparable


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()

See Also:
Object