weka.core.Utils.readProperties()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中weka.core.Utils.readProperties()方法的一些代码示例,展示了Utils.readProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.readProperties()方法的具体详情如下:
包路径:weka.core.Utils
类名称:Utils
方法名:readProperties

Utils.readProperties介绍

[英]Reads properties that inherit from three locations. Properties are first defined in the system resource location (i.e. in the CLASSPATH). These default properties must exist. Properties optionally defined in the user properties location (WekaPackageManager.PROPERTIES_DIR) override default settings. Properties defined in the current directory (optional) override all these settings.
[中]读取从三个位置继承的属性。属性首先在系统资源位置(即类路径)中定义。这些默认属性必须存在。用户属性位置(WekaPackageManager.Properties_DIR)中可选定义的属性覆盖默认设置。在当前目录中定义的属性(可选)将覆盖所有这些设置。

代码示例

代码示例来源:origin: Waikato/meka

/**
 * Initializes the properties if necessary.
 */
public static synchronized Properties getProperties() {
  String      filename;
  if (m_Properties == null) {
    filename = "meka/gui/core/" + FILENAME;
    try {
      m_Properties = Utils.readProperties(filename);
    }
    catch (Exception e) {
      System.err.println("Failed to read properties: " + filename);
      e.printStackTrace();
      m_Properties = new Properties();
    }
  }
  return m_Properties;
}

代码示例来源:origin: net.sf.meka/meka

/**
 * Initializes the properties if necessary.
 */
public static synchronized Properties getProperties() {
  String      filename;
  if (m_Properties == null) {
    filename = "meka/gui/core/" + FILENAME;
    try {
      m_Properties = Utils.readProperties(filename);
    }
    catch (Exception e) {
      System.err.println("Failed to read properties: " + filename);
      e.printStackTrace();
      m_Properties = new Properties();
    }
  }
  return m_Properties;
}

代码示例来源:origin: Waikato/meka

/**
 * Reads properties that inherit from three locations. Properties are first
 * defined in the system resource location (i.e. in the CLASSPATH). These
 * default properties must exist. Properties optionally defined in the user
 * properties location (WekaPackageManager.PROPERTIES_DIR) override default
 * settings. Properties defined in the current directory (optional) override
 * all these settings.
 *
 * @param props the location of the props file that should be loaded.
 *          e.g.: "weka/core/Utils.props".
 * @return the Properties
 * @throws Exception if an error occurs reading the properties files.
 * @see Utils#readProperties(String)
 */
public static Properties read(String props) throws Exception {
 Properties    result;
 result = Utils.readProperties(props);
 if (DEBUG)
  System.out.println("start<PropsUtils.read: " + props + ">\n" + toString(result, null) + "end<PropsUtils.read: " + props + ">\n");
 return result;
}

代码示例来源:origin: net.sf.meka/meka

/**
 * Reads properties that inherit from three locations. Properties are first
 * defined in the system resource location (i.e. in the CLASSPATH). These
 * default properties must exist. Properties optionally defined in the user
 * properties location (WekaPackageManager.PROPERTIES_DIR) override default
 * settings. Properties defined in the current directory (optional) override
 * all these settings.
 *
 * @param props the location of the props file that should be loaded.
 *          e.g.: "weka/core/Utils.props".
 * @return the Properties
 * @throws Exception if an error occurs reading the properties files.
 * @see Utils#readProperties(String)
 */
public static Properties read(String props) throws Exception {
 Properties    result;
 result = Utils.readProperties(props);
 if (DEBUG)
  System.out.println("start<PropsUtils.read: " + props + ">\n" + toString(result, null) + "end<PropsUtils.read: " + props + ">\n");
 return result;
}

代码示例来源:origin: Waikato/weka-trunk

defaultProps = Utils.readProperties(PROPERTY_FILE);
} catch (Exception ex) {
 System.err.println("Warning, unable to read default properties file(s).");

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

defaultProps = Utils.readProperties(PROPERTY_FILE);
} catch (Exception ex) {
 System.err.println("Warning, unable to read default properties file(s).");

代码示例来源:origin: nz.ac.waikato.cms.weka/meka

/**
 * registers all the editors in WEKA and MEKA.
 */
public static void registerAllEditors() {
 Properties         props;
 Enumeration     enm;
 String         name;
 String         value;
 registerEditors();
 if (m_MekaEditorsRegistered)
  return;
 System.err.println("---Registering MEKA Editors---");
 m_MekaEditorsRegistered = true;
 // load properties
 try {
  props = Utils.readProperties(MEKA_GUIEDITORS_PROPERTY_FILE);
 }
 catch (Exception e) {
  props = new Properties();
  e.printStackTrace();
 }
 enm = props.propertyNames();
 while (enm.hasMoreElements()) {
  name  = enm.nextElement().toString();
  value = props.getProperty(name, "");
  registerEditor(name, value);
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

props = Utils.readProperties(GUIEDITORS_PROPERTY_FILE);
} catch (Exception e) {
 props = new Properties();

代码示例来源:origin: Waikato/weka-trunk

props = Utils.readProperties(GUIEDITORS_PROPERTY_FILE);
} catch (Exception e) {
 props = new Properties();

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_InputProperties.load(new FileInputStream(getInputFilename()));
} else {
 m_InputProperties = Utils.readProperties(getInputFilename());
Properties p = Utils.readProperties(EXCLUDE_FILE);
Enumeration<?> enm = p.propertyNames();
while (enm.hasMoreElements()) {

代码示例来源:origin: Waikato/weka-trunk

/**
 * Performs some initialization.
 */
protected void initialize() {
 Properties props;
 try {
  props = Utils.readProperties(PROPERTIES_FILE);
 } catch (Exception e) {
  e.printStackTrace();
  props = new Properties();
 }
 m_FontColor = getColor(props.getProperty("FontColor", ""));
 m_BackgroundColor = getColor(props.getProperty("BackgroundColor", ""));
 m_NodeColor = getColor(props.getProperty("NodeColor", ""));
 m_LineColor = getColor(props.getProperty("LineColor", ""));
 m_ZoomBoxColor = getColor(props.getProperty("ZoomBoxColor", ""));
 m_ZoomBoxXORColor = getColor(props.getProperty("ZoomBoxXORColor", ""));
 m_ShowBorder = Boolean
  .parseBoolean(props.getProperty("ShowBorder", "true"));
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Performs some initialization.
 */
protected void initialize() {
 Properties props;
 try {
  props = Utils.readProperties(PROPERTIES_FILE);
 } catch (Exception e) {
  e.printStackTrace();
  props = new Properties();
 }
 m_FontColor = getColor(props.getProperty("FontColor", ""));
 m_BackgroundColor = getColor(props.getProperty("BackgroundColor", ""));
 m_NodeColor = getColor(props.getProperty("NodeColor", ""));
 m_LineColor = getColor(props.getProperty("LineColor", ""));
 m_ZoomBoxColor = getColor(props.getProperty("ZoomBoxColor", ""));
 m_ZoomBoxXORColor = getColor(props.getProperty("ZoomBoxXORColor", ""));
 m_ShowBorder = Boolean
  .parseBoolean(props.getProperty("ShowBorder", "true"));
}

代码示例来源:origin: Waikato/weka-trunk

m_InputProperties.load(new FileInputStream(getInputFilename()));
} else {
 m_InputProperties = Utils.readProperties(getInputFilename());
Properties p = Utils.readProperties(EXCLUDE_FILE);
Enumeration<?> enm = p.propertyNames();
while (enm.hasMoreElements()) {

代码示例来源:origin: Waikato/weka-trunk

props = Utils.readProperties(PROPERTIES_FILE);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

props = Utils.readProperties(PROPERTIES_FILE);

代码示例来源:origin: Waikato/weka-trunk

props = Utils.readProperties(PROPERTIES_FILE);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

props = Utils.readProperties(PROPERTIES_FILE);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

EDITOR_PROPERTIES = Utils.readProperties(PROPERTY_FILE);
java.util.Enumeration<?> keys = EDITOR_PROPERTIES.propertyNames();
if (!keys.hasMoreElements()) {

代码示例来源:origin: Waikato/weka-trunk

/**
 * Initializes generic object editor properties
 *
 * @return a properties object
 * @throws Exception if a problem occurs
 */
protected Properties initGOEProps() throws Exception {
 Properties GOEProps = GenericPropertiesCreator.getGlobalOutputProperties();
 if (GOEProps == null) {
  GenericPropertiesCreator creator = new GenericPropertiesCreator();
  if (creator.useDynamic()) {
   creator.execute(false);
   GOEProps = creator.getOutputProperties();
  } else {
   GOEProps = Utils.readProperties("weka/gui/GenericObjectEditor.props");
  }
 }
 return GOEProps;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Initializes generic object editor properties
 *
 * @return a properties object
 * @throws Exception if a problem occurs
 */
protected Properties initGOEProps() throws Exception {
 Properties GOEProps = GenericPropertiesCreator.getGlobalOutputProperties();
 if (GOEProps == null) {
  GenericPropertiesCreator creator = new GenericPropertiesCreator();
  if (creator.useDynamic()) {
   creator.execute(false);
   GOEProps = creator.getOutputProperties();
  } else {
   GOEProps = Utils.readProperties("weka/gui/GenericObjectEditor.props");
  }
 }
 return GOEProps;
}

相关文章