com.jme3.system.AppSettings.entrySet()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(98)

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

AppSettings.entrySet介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Saves all settings to the given properties output stream.
 *
 * @param out The OutputStream to write to
 * @throws IOException If an IOException occurs
 *
 * @see #load(java.io.InputStream)
 */
public void save(OutputStream out) throws IOException {
  Properties props = new Properties();
  for (Map.Entry<String, Object> entry : entrySet()) {
    Object val = entry.getValue();
    String type;
    if (val instanceof Integer) {
      type = "(int)";
    } else if (val instanceof String) {
      type = "(string)";
    } else if (val instanceof Boolean) {
      type = "(bool)";
    } else if (val instanceof Float) {
      type = "(float)";
    } else {
      // See the note in the AppSettings.save(String)
      // method regarding object type settings.
      continue;
    }
    props.setProperty(entry.getKey() + type, val.toString());
  }
  props.store(out, "jME3 AppSettings");
}

代码示例来源:origin: info.projectkyoto/mms-engine

/**
 * Saves all settings to the given properties output stream.
 * 
 * @param out The OutputStream to write to
 * @throws IOException If an IOException occurs
 * 
 * @see #load(java.io.InputStream) 
 */
public void save(OutputStream out) throws IOException {
  Properties props = new Properties();
  for (Map.Entry<String, Object> entry : entrySet()) {
    Object val = entry.getValue();
    String type;
    if (val instanceof Integer) {
      type = "(int)";
    } else if (val instanceof String) {
      type = "(string)";
    } else if (val instanceof Boolean) {
      type = "(bool)";
    } else {
      throw new UnsupportedEncodingException();
    }
    props.setProperty(entry.getKey() + type, val.toString());
  }
  props.store(out, "jME3 AppSettings");
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

/**
 * Saves all settings to the given properties output stream.
 *
 * @param out The OutputStream to write to
 * @throws IOException If an IOException occurs
 *
 * @see #load(java.io.InputStream)
 */
public void save(OutputStream out) throws IOException {
  Properties props = new Properties();
  for (Map.Entry<String, Object> entry : entrySet()) {
    Object val = entry.getValue();
    String type;
    if (val instanceof Integer) {
      type = "(int)";
    } else if (val instanceof String) {
      type = "(string)";
    } else if (val instanceof Boolean) {
      type = "(bool)";
    } else if (val instanceof Float) {
      type = "(float)";
    } else {
      // See the note in the AppSettings.save(String)
      // method regarding object type settings.
      continue;
    }
    props.setProperty(entry.getKey() + type, val.toString());
  }
  props.store(out, "jME3 AppSettings");
}

相关文章

AppSettings类方法