com.starteam.viewcomparemerge
Class EveryScope

java.lang.Object
  extended by com.starteam.viewcomparemerge.Scope
      extended by com.starteam.viewcomparemerge.EveryScope

public class EveryScope
extends Scope

Combines multiple scopes. An item is considered in scope if it is included in every member scope.

See Also:
Session.setScope(com.starteam.viewcomparemerge.Scope), Scope

Constructor Summary
EveryScope()
          Creates an empty scope.
EveryScope(Scope[] scopes)
          Creates a scope that initially contains the given members.
 
Method Summary
 void add(Scope scope)
          Adds the given member scope.
 java.lang.String getDescription()
          Return a description of this scope.
 Item getIncludedRevision(Item item)
          Determines whether or not the given source item is in scope for the current view compare/merge operation, and, if so, returns the item revision that should be used for comparision.
 TypeCollection getItemTypes()
          Get the list of item types that are included in this scope.
 boolean isFullScope(Item.Type type)
          Determines whether or not this represents a "Full Scope" operation for the given item type.
 void refresh(Session session)
          Provides a scope the opportunity to initialize or refresh its state.
 void remove(Scope scope)
          Removes the given member scope.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EveryScope

public EveryScope()
Creates an empty scope.


EveryScope

public EveryScope(Scope[] scopes)
Creates a scope that initially contains the given members.

Parameters:
scopes - the scopes to include
Method Detail

add

public void add(Scope scope)
Adds the given member scope.

Parameters:
scope - The scope to be added.

remove

public void remove(Scope scope)
Removes the given member scope.

Parameters:
scope - The scope to be removed.

getDescription

public java.lang.String getDescription()
Return a description of this scope. The description has this form: - if only one item is found, its display name is used. - if only two items are found, their display names are used: 'name1 AND name2'. - if more than two items are found, two are used: 'name1 AND name2 ... etc.'.

Specified by:
getDescription in class Scope
Returns:
a descriptive string

isFullScope

public boolean isFullScope(Item.Type type)
Description copied from class: Scope
Determines whether or not this represents a "Full Scope" operation for the given item type. If a scope restricts anything other than the item type, it is not considered a full scope operation.

Specified by:
isFullScope in class Scope
Parameters:
type - the type to test for
Returns:
true if the type is at full scope
See Also:
Scope.isFullScope(com.starteam.Item.Type)

refresh

public void refresh(Session session)
Description copied from class: Scope
Provides a scope the opportunity to initialize or refresh its state. As a result, some Items that were previously in scope may now be out of scope, and vice versa.

The view compare/merge engine calls refresh() once at the start of Session.compare(), and once for each call to Session.refresh().

Specified by:
refresh in class Scope
Parameters:
session - the session to refresh
See Also:
Scope.refresh(com.starteam.viewcomparemerge.Session)

getItemTypes

public TypeCollection getItemTypes()
Description copied from class: Scope
Get the list of item types that are included in this scope. Note that folders are always processed, whether or not the scope indicates that they should be included.

Specified by:
getItemTypes in class Scope
Returns:
a type collection of included types
See Also:
Scope.getItemTypes()

getIncludedRevision

public Item getIncludedRevision(Item item)
Description copied from class: Scope
Determines whether or not the given source item is in scope for the current view compare/merge operation, and, if so, returns the item revision that should be used for comparision.

During a compare operation, the getIncludedRevision() method is called for every source folder whose parent is in scope, and for every item whose type and parent folder are in scope.

Each implementation of Scope must guarantee that if getIncludedRevision() is called again on the same item, without an intervening call to refresh(), the result is the same between calls. That is, until a refresh() is called, a given item must be consistently in scope or out of scope.

Scope implementations may assume that getIncludedRevision() is called only for types that are in scope (and folders).

Specified by:
getIncludedRevision in class Scope
Parameters:
item - the item to test for inclusion
Returns:
the included revision of the item if any
See Also:
Scope.getIncludedRevision(com.starteam.Item)


StarTeam SDK 13.0, Build 31
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.