Perforce

com.perforce.api
Class Mapping

java.lang.Object
  |
  +--com.perforce.api.SourceControlObject
        |
        +--com.perforce.api.Mapping
All Implemented Interfaces:
Cacheable, Comparable
Direct Known Subclasses:
Branch, Client, Label

public abstract class Mapping
extends SourceControlObject
implements Comparable

Representation of a source control mapping. This handles a named set of file mappings.

Version:
$Date: 2002/08/05 $ $Revision: #6 $
Author:
David Markley

Constructor Summary
Mapping()
          Default no-argument constructor.
Mapping(String name)
          Constructor that is passed the mapping name.
 
Method Summary
 void addView(String line)
           
 void addView(String from, String to)
          Add a view to the Mapping.
abstract  void commit()
          Stores this object back into Perforce, creating it if it didn't already exist.
 int compareTo(Object o)
           
 String getDescription()
          Returns the Mapping description.
 String getName()
          Returns the name of the Mapping.
 String getOwner()
          Returns the owner of the Mapping.
 String getView()
           
 Enumeration getViews()
           
static Enumeration lookupMappings(HashDecay mappings, String prefix)
          Returns a list of mappings that begin with the specified prefix.
 void setDescription(String description)
          Sets the description for the Mapping.
 void setName(String name)
          Sets the name of the Mapping.
 void setOwner(String owner)
          Sets the owner of the Mapping.
abstract  void sync(String name)
          Synchronizes the Mapping with the latest information from P4.
 String toString()
           
 String toXML()
          Returns a string containing the object in XML form.
 
Methods inherited from class com.perforce.api.SourceControlObject
clearCache, getCache, getEnv, getSyncTime, getUpdateTime, inSync, invalidate, outOfSync, refreshUpdateTime, setEnv, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping()
Default no-argument constructor.

Mapping

public Mapping(String name)
Constructor that is passed the mapping name.
Method Detail

addView

public void addView(String line)

addView

public void addView(String from,
                    String to)
Add a view to the Mapping.
Parameters:
view - View for the mapping.

commit

public abstract void commit()
                     throws CommitException
Description copied from class: SourceControlObject
Stores this object back into Perforce, creating it if it didn't already exist.
Overrides:
commit in class SourceControlObject

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getDescription

public String getDescription()
Returns the Mapping description.

getName

public String getName()
Returns the name of the Mapping.

getOwner

public String getOwner()
Returns the owner of the Mapping.

getView

public String getView()
Returns:
String version of all the views in this mapping.

getViews

public Enumeration getViews()
Returns:
Enumerated list of the views in this mapping.

lookupMappings

public static Enumeration lookupMappings(HashDecay mappings,
                                         String prefix)
Returns a list of mappings that begin with the specified prefix.
Parameters:
prefix - Prefix for all mappings to be returned
Returns:
List of mappings matching the prefix.

setDescription

public void setDescription(String description)
Sets the description for the Mapping.
Parameters:
description - Description of the mapping.

setName

public void setName(String name)
Sets the name of the Mapping.
Parameters:
name - Name of the mapping.

setOwner

public void setOwner(String owner)
Sets the owner of the Mapping.
Parameters:
owner - Owner of the mapping.

sync

public abstract void sync(String name)
Synchronizes the Mapping with the latest information from P4. This method forces the Mapping to contain the latest, correct information if it didn't already.
Parameters:
name - Name of the Mapping to synchronize.

toString

public String toString()
Overrides:
toString in class Object
Returns:
Name of the mapping.

toXML

public String toXML()
Description copied from class: SourceControlObject
Returns a string containing the object in XML form.
Overrides:
toXML in class SourceControlObject

Perforce

Copyright © 2001, Perforce Software, All rights reserved.