com.perforce.api
Class Mapping

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

public abstract class Mapping
extends SourceControlObject
implements java.lang.Comparable

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

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

Constructor Summary
Mapping()
          Default no-argument constructor.
Mapping(java.lang.String name)
          Constructor that is passed the mapping name.
 
Method Summary
 void addView(java.lang.String line)
           
 void addView(java.lang.String from, java.lang.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(java.lang.Object o)
           
 java.lang.String getDescription()
          Returns the Mapping description.
 java.lang.String getName()
          Returns the name of the Mapping.
 java.lang.String getOwner()
          Returns the owner of the Mapping.
 java.lang.String getView()
           
 java.util.Enumeration getViews()
           
static java.util.Enumeration lookupMappings(HashDecay mappings, java.lang.String prefix)
          Returns a list of mappings that begin with the specified prefix.
 void setDescription(java.lang.String description)
          Sets the description for the Mapping.
 void setName(java.lang.String name)
          Sets the name of the Mapping.
 void setOwner(java.lang.String owner)
          Sets the owner of the Mapping.
abstract  void sync(java.lang.String name)
          Synchronizes the Mapping with the latest information from P4.
 java.lang.String toString()
           
 java.lang.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(java.lang.String name)
Constructor that is passed the mapping name.

Method Detail

compareTo

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

setName

public void setName(java.lang.String name)
Sets the name of the Mapping.

Parameters:
name - Name of the mapping.

getName

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


setOwner

public void setOwner(java.lang.String owner)
Sets the owner of the Mapping.

Parameters:
owner - Owner of the mapping.

getOwner

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


setDescription

public void setDescription(java.lang.String description)
Sets the description for the Mapping.

Parameters:
description - Description of the mapping.

getDescription

public java.lang.String getDescription()
Returns the Mapping description.


addView

public void addView(java.lang.String from,
                    java.lang.String to)
Add a view to the Mapping.

Parameters:
view - View for the mapping.

addView

public void addView(java.lang.String line)

getView

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

getViews

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

lookupMappings

public static java.util.Enumeration lookupMappings(HashDecay mappings,
                                                   java.lang.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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Name of 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.

Specified by:
commit in interface Cacheable
Specified by:
commit in class SourceControlObject
Throws:
CommitException

sync

public abstract void sync(java.lang.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.

toXML

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

Specified by:
toXML in class SourceControlObject


Copyright © 2010. All Rights Reserved.