wt.util
Class MappedRegistry

java.lang.Object
  extended bywt.util.MappedRegistry

public class MappedRegistry
extends Object


Field Summary
protected  String absolutePath
           
private static Hashtable allInstances
           
protected  String description
           
private  boolean dirty
           
private  int entriesRead
           
protected  String propertyFileName
           
private  PropertiesMap registry
           
private static String RESOURCE
           
(package private) static boolean TRACE
           
 
Constructor Summary
protected MappedRegistry()
           
  MappedRegistry(String fileName, String dir)
           
 
Method Summary
 MappedRegistry additions(MappedRegistry otherRegistry, String additions_dir)
          Returns a new MappedRegistry containing additions, with the new registry stored in additions_dir.
 int count(String key)
           
 int countPair(String key, String value)
           
 void difference(MappedRegistry otherRegistry)
          Returns the difference between two MappedRegistry's, i.e.
 void difference(MappedRegistry otherRegistry, String add_dir, String remove_dir)
          Creates a new MappedRegistry containing additions and another one containing removals, with the new registries stored in the specified directories.
 Enumeration elements()
           
static MappedRegistry get(String fileName)
           
static MappedRegistry get(String fileName, String dir)
           
private static String getKey(String fileName, String dir)
           
 Object getValue(String key)
           
 Enumeration keys()
           
static void main(String[] args)
           
 void putPair(String key, String value)
           
protected  void read()
           
protected  PropertiesMap readFile()
           
 MappedRegistry removals(MappedRegistry otherRegistry, String removals_dir)
          Returns a new MappedRegistry containing removals, with the new registry stored in removals_dir.
 void remove(MappedRegistry otherRegistry)
          Removes the entries in the otherRegistry from this one.
 Object removeKeys(String key)
           
 void removePair(String key, String value)
           
 int removeValues(String value)
           
 void setDescription(String registryDescription)
           
 int size()
           
 String toString()
           
 void union(MappedRegistry otherRegistry)
          Merges the entries from the otherRegistry into this one.
 Enumeration values(String key)
           
 void write()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

TRACE

static boolean TRACE

allInstances

private static final Hashtable allInstances

registry

private PropertiesMap registry

dirty

private boolean dirty

entriesRead

private int entriesRead

propertyFileName

protected String propertyFileName

description

protected String description

absolutePath

protected String absolutePath
Constructor Detail

MappedRegistry

protected MappedRegistry()

MappedRegistry

public MappedRegistry(String fileName,
                      String dir)
Method Detail

getKey

private static String getKey(String fileName,
                             String dir)

size

public final int size()

count

public final int count(String key)

countPair

public int countPair(String key,
                     String value)

elements

public Enumeration elements()

get

public static MappedRegistry get(String fileName)
                          throws WTException
Throws:
WTException

get

public static MappedRegistry get(String fileName,
                                 String dir)
                          throws WTException
Throws:
WTException

getValue

public Object getValue(String key)

keys

public Enumeration keys()

main

public static void main(String[] args)

putPair

public void putPair(String key,
                    String value)

read

protected void read()
             throws WTException
Throws:
WTException

readFile

protected PropertiesMap readFile()

removeKeys

public Object removeKeys(String key)

removePair

public void removePair(String key,
                       String value)

removeValues

public int removeValues(String value)

setDescription

public void setDescription(String registryDescription)

toString

public String toString()

union

public void union(MappedRegistry otherRegistry)
Merges the entries from the otherRegistry into this one.


difference

public void difference(MappedRegistry otherRegistry)
Returns the difference between two MappedRegistry's, i.e. the values appearing in this map which are NOT present in the "map" to which it is compared.


difference

public void difference(MappedRegistry otherRegistry,
                       String add_dir,
                       String remove_dir)
Creates a new MappedRegistry containing additions and another one containing removals, with the new registries stored in the specified directories.


additions

public MappedRegistry additions(MappedRegistry otherRegistry,
                                String additions_dir)
Returns a new MappedRegistry containing additions, with the new registry stored in additions_dir.


removals

public MappedRegistry removals(MappedRegistry otherRegistry,
                               String removals_dir)
Returns a new MappedRegistry containing removals, with the new registry stored in removals_dir.


remove

public void remove(MappedRegistry otherRegistry)
Removes the entries in the otherRegistry from this one.


values

public Enumeration values(String key)

write

public void write()