cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/caching DeltaTimeCacheValidity.java
Date Fri, 16 Nov 2001 14:39:25 GMT
giacomo     01/11/16 06:39:25

  Modified:    src/org/apache/cocoon/caching DeltaTimeCacheValidity.java
  Log:
  fixed according to coding convention used for Cocoon
  
  Revision  Changes    Path
  1.2       +8 -14     xml-cocoon2/src/org/apache/cocoon/caching/DeltaTimeCacheValidity.java
  
  Index: DeltaTimeCacheValidity.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/caching/DeltaTimeCacheValidity.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeltaTimeCacheValidity.java	2001/11/16 13:54:52	1.1
  +++ DeltaTimeCacheValidity.java	2001/11/16 14:39:25	1.2
  @@ -16,34 +16,28 @@
    * @author Michael Homeijer
    */
   
  -public final class DeltaTimeCacheValidity implements CacheValidity
  -{
  +public final class DeltaTimeCacheValidity implements CacheValidity {
   
       private long cachedDateTime;  // Holds the store-time in miliseconds
       private long timeInCache;     // maximum time allowed in cache in minutes
   
  -    public DeltaTimeCacheValidity(long timeInCache)
  -    {
  -	this.cachedDateTime = new Date().getTime();
  -	this.timeInCache = timeInCache * 60000;
  +    public DeltaTimeCacheValidity(long timeInCache) {
  +        this.cachedDateTime = System.currentTimeMillis();
  +        this.timeInCache = timeInCache * 60000;
       }
   
  -    public boolean isValid(CacheValidity validity)
  -    {
  -        if (validity instanceof DeltaTimeCacheValidity)
  -        {
  +    public boolean isValid(CacheValidity validity) {
  +        if (validity instanceof DeltaTimeCacheValidity) {
               return Math.abs((((DeltaTimeCacheValidity)validity).getCachedDateTime() - this.cachedDateTime))
< this.timeInCache;
           }
           return false;
       }
   
  -    public long getCachedDateTime()
  -    {
  +    public long getCachedDateTime() {
           return this.cachedDateTime;
       }
   
  -    public String toString()
  -    {
  +    public String toString() {
           return "DeltaTimeCacheValidity: " + this.cachedDateTime + "(+" + this.timeInCache
+ "min)";
       }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message