weka.core
Class ProtectedProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by weka.core.ProtectedProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>, RevisionHandler

public class ProtectedProperties
extends Properties
implements RevisionHandler

Simple class that extends the Properties class so that the properties are unable to be modified.

Version:
$Revision: 8034 $
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
See Also:
Serialized Form

Constructor Summary
ProtectedProperties(Properties props)
          Creates a set of protected properties from a set of normal ones.
 
Method Summary
 void clear()
          Overrides a method to prevent the properties from being modified.
 String getRevision()
          Returns the revision string.
 void load(InputStream inStream)
          Overrides a method to prevent the properties from being modified.
 Object put(Object key, Object value)
          Overrides a method to prevent the properties from being modified.
 void putAll(Map t)
          Overrides a method to prevent the properties from being modified.
 Object remove(Object key)
          Overrides a method to prevent the properties from being modified.
 Object setProperty(String key, String value)
          Overrides a method to prevent the properties from being modified.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProtectedProperties

public ProtectedProperties(Properties props)
Creates a set of protected properties from a set of normal ones.

Parameters:
props - the properties to be stored and protected.
Method Detail

setProperty

public Object setProperty(String key,
                          String value)
Overrides a method to prevent the properties from being modified.

Overrides:
setProperty in class Properties
Returns:
never returns without throwing an exception.
Throws:
UnsupportedOperationException - always.

load

public void load(InputStream inStream)
Overrides a method to prevent the properties from being modified.

Overrides:
load in class Properties
Throws:
UnsupportedOperationException - always.

clear

public void clear()
Overrides a method to prevent the properties from being modified.

Specified by:
clear in interface Map<Object,Object>
Overrides:
clear in class Hashtable<Object,Object>
Throws:
UnsupportedOperationException - always.

put

public Object put(Object key,
                  Object value)
Overrides a method to prevent the properties from being modified.

Specified by:
put in interface Map<Object,Object>
Overrides:
put in class Hashtable<Object,Object>
Returns:
never returns without throwing an exception.
Throws:
UnsupportedOperationException - always.

putAll

public void putAll(Map t)
Overrides a method to prevent the properties from being modified.

Specified by:
putAll in interface Map<Object,Object>
Overrides:
putAll in class Hashtable<Object,Object>
Throws:
UnsupportedOperationException - always.

remove

public Object remove(Object key)
Overrides a method to prevent the properties from being modified.

Specified by:
remove in interface Map<Object,Object>
Overrides:
remove in class Hashtable<Object,Object>
Returns:
never returns without throwing an exception.
Throws:
UnsupportedOperationException - always.

getRevision

public String getRevision()
Returns the revision string.

Specified by:
getRevision in interface RevisionHandler
Returns:
the revision


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.