本文整理了Java中com.jme3.system.AppSettings.entrySet()
方法的一些代码示例,展示了AppSettings.entrySet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppSettings.entrySet()
方法的具体详情如下:
包路径:com.jme3.system.AppSettings
类名称: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");
}
内容来源于网络,如有侵权,请联系作者删除!