com.ptc.wvs.client.pview
Class PViewFileCache

java.lang.Object
  extended bycom.ptc.wvs.client.pview.PViewFileCache

public class PViewFileCache
extends Object

PViewFileCache is used to track the usage of files in the PViewCache When multiple instances of the viewer are in use, for a given url references to some viewable content (shapesource), PView will first look to its understanding of what files have been viewed. Hence when it comes to delete files from the cache, it is important no other instance of the viewer is using the file.



Supported API: false

Extendable: false


Field Summary
private  String file
           
private  String url
           
private  Vector usedBy
           
 
Constructor Summary
PViewFileCache(String url, String file, int usedby)
          Creates new PViewFileCache object
 
Method Summary
 void addUsedBy(int usedby)
          Adds another viewer reference
 String getFile()
          Returns the associated file reference
 String getUrl()
          Returns the associated url reference
 boolean isUsed()
          Determines if FileCache is referenced by any viewer
 boolean isUsedBy(int usedby)
          Determines if currently used by the specified viewer reference
 void removeUsedBy(int usedby)
          Removes a viewers reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usedBy

private Vector usedBy

url

private String url

file

private String file
Constructor Detail

PViewFileCache

public PViewFileCache(String url,
                      String file,
                      int usedby)
Creates new PViewFileCache object

Parameters:
url - the url that is referenced by PView
file - the actual file in the Cache
usedby - a reference to the viewer, typically the HWND (window handle)
Method Detail

addUsedBy

public void addUsedBy(int usedby)
Adds another viewer reference


isUsedBy

public boolean isUsedBy(int usedby)
Determines if currently used by the specified viewer reference

Returns:
True if currently used

removeUsedBy

public void removeUsedBy(int usedby)
Removes a viewers reference


isUsed

public boolean isUsed()
Determines if FileCache is referenced by any viewer

Returns:
True if currently used

getUrl

public String getUrl()
Returns the associated url reference

Returns:
the url

getFile

public String getFile()
Returns the associated file reference

Returns:
the file name