SmartFrog 3.10.000

org.smartfrog.services.filesystem.replacevar
Class ReplaceVar

java.lang.Object
  extended by org.smartfrog.services.filesystem.replacevar.ReplaceVar

public class ReplaceVar
extends java.lang.Object


Constructor Summary
ReplaceVar(java.lang.String filename)
          Passes the filename to the object on creation
ReplaceVar(java.lang.String filename, boolean cached)
          Passes the filename to the object on creation
ReplaceVar(java.lang.String filename, java.lang.String newfilename)
          Passes the filename to the object on creation
ReplaceVar(java.lang.String filename, java.lang.String newfilename, boolean cached)
          Passes the filename to the object on creation
 
Method Summary
 void append(java.util.Vector data)
          Sets a value for a specified key.
 void appendCached(java.util.Vector data)
          Sets a value for a specified key.
 void flush()
          Saves the cached information back out to the file.
 boolean getCachedState()
          Returns true if the file is cached in memory or false if it is read each time the object is called.
 java.lang.String getFilename()
          Returns a String that contains the name of the file currently being used.
static void main(java.lang.String[] args)
          Main method
 void setCachedState(boolean cached)
          Determines if the file is cached in memory or read each time it is called.
 void setFilename(java.lang.String filename)
          Sets the name of the file the object is using.
 void setSetting(java.util.HashMap data)
          Sets a value for a specified key.
 void setSetting(java.lang.String key, java.lang.String value)
          Sets a value for a specified key.
 void setSetting(java.util.Vector data)
          Sets a value for a specified key.
 void setSettingCached(java.util.HashMap data)
          Sets a value for a specified key.
 void setSettingCached(java.util.Vector data)
          Sets a value for a specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceVar

public ReplaceVar(java.lang.String filename)
Passes the filename to the object on creation

Parameters:
filename - the name of the file to use

ReplaceVar

public ReplaceVar(java.lang.String filename,
                  java.lang.String newfilename)
Passes the filename to the object on creation

Parameters:
filename - the name of the file to use

ReplaceVar

public ReplaceVar(java.lang.String filename,
                  java.lang.String newfilename,
                  boolean cached)
Passes the filename to the object on creation

Parameters:
filename - the name of the file to use
cached - whether the file is cached in memory or not

ReplaceVar

public ReplaceVar(java.lang.String filename,
                  boolean cached)
Passes the filename to the object on creation

Parameters:
filename - the name of the file to use
cached - whether the file is cached in memory or not
Method Detail

setCachedState

public void setCachedState(boolean cached)
Determines if the file is cached in memory or read each time it is called.

Parameters:
cached - true if the entire file is kept in memory; false if the file is not kept in memory

getCachedState

public boolean getCachedState()
Returns true if the file is cached in memory or false if it is read each time the object is called.

Returns:
true if the entire file is kept in memory; false if the file is not kept in memory

setFilename

public void setFilename(java.lang.String filename)
Sets the name of the file the object is using.

Parameters:
filename - the name of the file to use

getFilename

public java.lang.String getFilename()
Returns a String that contains the name of the file currently being used.

Returns:
a String that contains the name of the file

setSetting

public void setSetting(java.lang.String key,
                       java.lang.String value)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
key - the name of the key to change
value - the String value to change the key to

setSetting

public void setSetting(java.util.HashMap data)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
data - the hashmap

setSettingCached

public void setSettingCached(java.util.HashMap data)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
data - hashmap to write

setSetting

public void setSetting(java.util.Vector data)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
section - the section in the file
key - the name of the key to change
value - the String value to change the key to

setSettingCached

public void setSettingCached(java.util.Vector data)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
section - the section in the file
key - the name of the key to change
value - the String value to change the key to

append

public void append(java.util.Vector data)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
section - the section in the file
key - the name of the key to change
value - the String value to change the key to

appendCached

public void appendCached(java.util.Vector data)
Sets a value for a specified key. This temporarily loads the entire file into memory if it is not already cached. If the file is cached, the change is only in memory until the flush() method is called. If the file is not cached, then writes happen immediately.

Parameters:
section - the section in the file
key - the name of the key to change
value - the String value to change the key to

flush

public void flush()
Saves the cached information back out to the file. This method is only available when caching is turned on. Otherwise, it does nothing. If you do not call this method when caching is turned on, your changes will not be saved.


main

public static void main(java.lang.String[] args)
Main method


SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP