Package adams.env
Class Setup
- java.lang.Object
-
- adams.env.Setup
-
- All Implemented Interfaces:
Mergeable<Setup>,Serializable,Comparable
public class Setup extends Object implements Serializable, Comparable, Mergeable<Setup>
A container class for a props file and the directories to look for.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>m_Directoriesthe directories to look for.protected List<String>m_Overrideskeys (or regular expression of keys) that only the last props file is allowed to have.protected Stringm_PropertiesFilethe props file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)Compares this object with the specified object for order.booleanequals(Object obj)Indicates whether some other object is "equal to" this one.List<String>getDirectories()Returns the directories to search.StringgetFilename()Returns the filename of the properties file without the path.List<String>getOverrides()Returns the override keys (or regular expressions).StringgetPropertiesFile()Returns the properties file stored (incl path).inthashCode()Hashcode so can be used as hashtable key.booleanhasOverrides()Checks whether any overrides for keys are defined.voidmergeWith(Setup other)Merges its own data with the one provided by the specified setup.StringtoString()Returns a string representation of the container.
-
-
-
Method Detail
-
getPropertiesFile
public String getPropertiesFile()
Returns the properties file stored (incl path).- Returns:
- the props file
-
getFilename
public String getFilename()
Returns the filename of the properties file without the path.- Returns:
- the filename
-
getDirectories
public List<String> getDirectories()
Returns the directories to search.- Returns:
- the directories
-
hasOverrides
public boolean hasOverrides()
Checks whether any overrides for keys are defined.- Returns:
- true if overrides available
-
getOverrides
public List<String> getOverrides()
Returns the override keys (or regular expressions).- Returns:
- the keys (or regular expressions)
-
mergeWith
public void mergeWith(Setup other)
Merges its own data with the one provided by the specified setup. But only if the filenames (without the path) are the same.
-
compareTo
public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareToin interfaceComparable- Parameters:
o- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
-
hashCode
public int hashCode()
Hashcode so can be used as hashtable key. Returns the hashcode of the props file string.
-
-