Perforce

com.perforce.api
Class Counter

java.lang.Object
  extended by com.perforce.api.SourceControlObject
      extended by com.perforce.api.Counter
All Implemented Interfaces:
Cacheable

public final class Counter
extends SourceControlObject

Representation of perforce counters. This class can be used to set and get the value of a counter. It can also be used to determine who reviews the changes represented by a particular value.

Version:
$Date: 2007/07/30 $ $Revision: #1 $
Author:
David Markley

Constructor Summary
Counter()
          Default no-argument constructor.
Counter(Env environ, String name)
           
Counter(String name)
           
 
Method Summary
 void commit()
          Stores this object back into Perforce, creating it if it didn't already exist.
 HashDecay getCache()
          Returns the HashDecay instance for this class
static Counter[] getCounters(Env env)
          Returns an array of all the Counters established on the server.
 String getName()
           
 int getValue()
          Returns the value of this Counter.
 Change[] review()
          Determine the changelists that need to be reviewed.
 void setName(String name)
           
 void setValue(int value)
          Sets the value for the Counter.
 void sync()
          Brings this object back into sync with Perforce.
 String toXML()
          Returns a string containing the object in XML form.
 
Methods inherited from class com.perforce.api.SourceControlObject
clearCache, getEnv, getSyncTime, getUpdateTime, inSync, invalidate, outOfSync, refreshUpdateTime, setEnv
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Counter

public Counter()
Default no-argument constructor.


Counter

public Counter(Env environ,
               String name)

Counter

public Counter(String name)
Method Detail

commit

public 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

getCache

public HashDecay getCache()
Description copied from class: SourceControlObject
Returns the HashDecay instance for this class

Specified by:
getCache in interface Cacheable
Specified by:
getCache in class SourceControlObject

getCounters

public static Counter[] getCounters(Env env)
                             throws PerforceException
Returns an array of all the Counters established on the server.

Throws:
PerforceException

getName

public String getName()

getValue

public int getValue()
Returns the value of this Counter.


review

public Change[] review()
                throws PerforceException
Determine the changelists that need to be reviewed. This method returns an array of Changes that need to be reviewed.

Throws:
PerforceException

setName

public void setName(String name)

setValue

public void setValue(int value)
Sets the value for the Counter.

Parameters:
value - New counter value

sync

public void sync()
          throws PerforceException
Description copied from class: SourceControlObject
Brings this object back into sync with Perforce. This also sets the sets the update and sync time for this object.

Specified by:
sync in interface Cacheable
Specified by:
sync in class SourceControlObject
Throws:
PerforceException

toXML

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

Specified by:
toXML in class SourceControlObject

Perforce

Copyright © 2001, Perforce Software, All rights reserved.