当前位置: 首页>>代码示例>>Java>>正文


Java ExplorerDefaults类代码示例

本文整理汇总了Java中weka.gui.explorer.ExplorerDefaults的典型用法代码示例。如果您正苦于以下问题:Java ExplorerDefaults类的具体用法?Java ExplorerDefaults怎么用?Java ExplorerDefaults使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExplorerDefaults类属于weka.gui.explorer包,在下文中一共展示了ExplorerDefaults类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeExplorerProps

import weka.gui.explorer.ExplorerDefaults; //导入依赖的package包/类
/**
 * Remove any ExplorerDefaults properties specified in the supplied package
 * 
 * @param installedPackageName the package specifying properties that should
 *          be removed from ExplorerDefaults
 */
public static void removeExplorerProps(String installedPackageName) {
  try {
    Properties expProps = new Properties();
    String explorerProps =
      getPackageHome().getAbsolutePath() + File.separator
        + installedPackageName + File.separator + "Explorer.props";
    BufferedInputStream bi =
      new BufferedInputStream(new FileInputStream(explorerProps));
    expProps.load(bi);
    bi.close();
    bi = null;
    Set<Object> keys = expProps.keySet();
    Iterator<Object> keysI = keys.iterator();
    while (keysI.hasNext()) {
      String key = (String) keysI.next();
      if (!key.endsWith("Policy")) {
        // See if this key is in the Explorer props
        String existingVal = ExplorerDefaults.get(key, "");
        String toRemove = expProps.getProperty(key);
        if (existingVal.length() > 0) {
          // cover the case when the value to remove is at the start
          // or middle of a list
          existingVal = existingVal.replace(toRemove + ",", "");

          // the case when it's at the end
          existingVal = existingVal.replace("," + toRemove, "");
          ExplorerDefaults.set(key, existingVal);
        }
      }
    }
  } catch (Exception ex) {
  }
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:40,代码来源:WekaPackageManager.java

示例2: removeExplorerProps

import weka.gui.explorer.ExplorerDefaults; //导入依赖的package包/类
public static void removeExplorerProps(String installedPackageName) {
  try {
    Properties expProps = new Properties();
    String explorerProps = getPackageHome().getAbsolutePath()
        + File.separator + installedPackageName + File.separator
        + "Explorer.props";
    BufferedInputStream bi = new BufferedInputStream(new FileInputStream(
        explorerProps));
    expProps.load(bi);
    bi.close();
    bi = null;
    Set keys = expProps.keySet();
    Iterator keysI = keys.iterator();
    while (keysI.hasNext()) {
      String key = (String) keysI.next();
      if (!key.endsWith("Policy")) {
        // See if this key is in the Explorer props
        String existingVal = ExplorerDefaults.get(key, "");
        String toRemove = expProps.getProperty(key);
        if (existingVal.length() > 0) {
          // cover the case when the value to remove is at the start
          // or middle of a list
          existingVal = existingVal.replace(toRemove + ",", "");

          // the case when it's at the end
          existingVal = existingVal.replace("," + toRemove, "");
          ExplorerDefaults.set(key, existingVal);
        }
      }
    }
  } catch (Exception ex) {
  }
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:34,代码来源:WekaPackageManager.java


注:本文中的weka.gui.explorer.ExplorerDefaults类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。