Perforce

com.perforce.api
Class Counter

java.lang.Object
  |
  +--com.perforce.api.SourceControlObject
        |
        +--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: 2002/01/16 $ $Revision: #4 $
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.
Overrides:
commit in class SourceControlObject

getCache

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

getCounters

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

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.

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.
Overrides:
sync in class SourceControlObject

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.