程序包 weka.core

类 Environment

java.lang.Object
weka.core.Environment
所有已实现的接口:
RevisionHandler

public class Environment extends Object implements RevisionHandler
This class encapsulates a map of all environment and java system properties. There are methods for adding and removing variables as well as a method for replacing key names (enclosed by ${}) with their associated value in Strings.
版本:
$Revision: 5562 $
作者:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
  • 构造器详细资料

    • Environment

      public Environment()
  • 方法详细资料

    • getSystemWide

      public static Environment getSystemWide()
      Get the singleton system-wide (visible to every class in the running VM) set of environment variables.
      返回:
      the system-wide set of environment variables.
    • containsEnvVariables

      public static boolean containsEnvVariables(String source)
      Tests for the presence of environment variables.
      参数:
      source - the string to test
      返回:
      true if the argument contains one or more environment variables
    • substitute

      public String substitute(String source) throws Exception
      Substitute a variable names for their values in the given string.
      参数:
      source - the source string to replace variables in
      返回:
      a String with all variable names replaced with their values
      抛出:
      Exception - if an unknown variable name is encountered
    • addVariable

      public void addVariable(String key, String value)
      Add a variable to the internal map.
      参数:
      key - the name of the variable
      value - its value
    • removeVariable

      public void removeVariable(String key)
      Remove a named variable from the map.
      参数:
      key - the name of the varaible to remove.
    • getVariableNames

      public Set<String> getVariableNames()
      Get the names of the variables (keys) stored in the internal map.
      返回:
      a Set of variable names (keys)
    • getVariableValue

      public String getVariableValue(String key)
      Get the value for a particular variable.
      参数:
      key - the name of the variable to get
      返回:
      the associated value or null if this variable is not in the internal map
    • main

      public static void main(String[] args)
      Main method for testing this class.
      参数:
      args - a list of strings to replace variables in (e.g. "\${os.name} "\${java.version}")
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision