weka.core.Defaults Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weka-stable Show documentation
Show all versions of weka-stable Show documentation
The Waikato Environment for Knowledge Analysis (WEKA), a machine
learning workbench. This is the stable version. Apart from bugfixes, this version
does not receive any other updates.
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/*
* Defaults.java
* Copyright (C) 2014 University of Waikato, Hamilton, New Zealand
*
*/
package weka.core;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Base class for providing a set of default settings for an application.
*
* @author Mark Hall (mhall{[at]}pentaho{[dot]}com)
* @version $Revision: $
*/
public class Defaults implements Serializable {
/** For serialization */
private static final long serialVersionUID = 1061521489520308096L;
/** Identifier for this set of defaults */
protected String m_defaultsID = "";
/** Maintains the list of default settings */
protected Map m_defaults =
new LinkedHashMap();
/**
* Construct a new empty Defaults
*
* @param ID the ID for this set of defaults
*/
public Defaults(String ID) {
setID(ID);
}
/**
* Construct a new Defaults
*
* @param ID the ID for this set of defaults
* @param defaults the default settings to use
*/
public Defaults(String ID, Map defaults) {
this(ID);
m_defaults = defaults;
}
/**
* Get the ID of this set of defaults
*
* @return the ID of this set of defaults
*/
public String getID() {
return m_defaultsID;
}
/**
* Set the ID for this set of defaults
*
* @param ID the ID to use
*/
public void setID(String ID) {
m_defaultsID = ID;
}
/**
* Get the map of default settings
*
* @return the map of default settings
*/
public Map getDefaults() {
return m_defaults;
}
/**
* Add the supplied defaults to this one. Note that the added defaults now
* come under the ID of this set of defaults.
*
* @param toAdd the defaults to add
*/
public void add(Defaults toAdd) {
m_defaults.putAll(toAdd.getDefaults());
}
}