net.sf.clirr.core
Class ScopeSelector

java.lang.Object
  extended by net.sf.clirr.core.ScopeSelector

public final class ScopeSelector
extends java.lang.Object

Selects zero or more java scope values (public, protected, package, private). An instance of this class is used when comparing two versions of an application to indicate what items are of interest. When the target audience is "normal" users of the applications, only changes to items which have public or protected scope are relevant. When the audience is developers of the applications, then package-scope and private-scope changes are also of interest.

Author:
Simon Kitching

Constructor Summary
ScopeSelector()
          Construct an instance which selects public and protected objects and ignores package and private objects.
ScopeSelector(Scope scope)
          Construct an instance which selects public and protected objects and ignores package and private objects.
 
Method Summary
 Scope getScope()
          Get the scope that this object is configured with.
 boolean isSelected(Scope scope)
          Return true if objects of the specified scope, or more visible, are selected by this selector.
 boolean isSelected(Scoped scoped)
          Given a scoped object, return true if this object's scope is one of the values this object is configured to match.
 void setScope(Scope scope)
          Specify which scope objects are of interest.
 java.lang.String toString()
          Return a string which indicates what scopes this object will consider to be selected (ie relevant).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScopeSelector

public ScopeSelector()
Construct an instance which selects public and protected objects and ignores package and private objects. The selectXXX methods can later be used to adjust this default behaviour.


ScopeSelector

public ScopeSelector(Scope scope)
Construct an instance which selects public and protected objects and ignores package and private objects. The selectXXX methods can later be used to adjust this default behaviour.

Method Detail

setScope

public void setScope(Scope scope)
Specify which scope objects are of interest.


getScope

public Scope getScope()
Get the scope that this object is configured with.


toString

public java.lang.String toString()
Return a string which indicates what scopes this object will consider to be selected (ie relevant).

Overrides:
toString in class java.lang.Object

isSelected

public boolean isSelected(Scoped scoped)
Given a scoped object, return true if this object's scope is one of the values this object is configured to match.

Parameters:
scoped - is the object whose scope is to be checked.
Returns:
true if the object is selected.

isSelected

public boolean isSelected(Scope scope)
Return true if objects of the specified scope, or more visible, are selected by this selector.

Parameters:
scope - is the scope being checked
Returns:
true if objects of the specified scope are selected.


Copyright © 2003-2005 Lars Kühne. All Rights Reserved.