disabledpreferencesfactory.java

来自「Standord Classifier实现了一个基于Java的最大熵分类器。用于」· Java 代码 · 共 36 行

JAVA
36
字号
package edu.stanford.nlp.util;import java.util.prefs.PreferencesFactory;import java.util.prefs.Preferences;/** * Returns do-nothing Preferences implementation.  We don't use this * facility, so we want to avoid the hassles that come with the JVM's * implementation.  * Taken from: http://www.allaboutbalance.com/disableprefs/index.html * * @author Robert Slifka * @author Christopher Manning * @version 2003/03/24 */public class DisabledPreferencesFactory implements PreferencesFactory {    public Preferences systemRoot() {        return new DisabledPreferences();    }    public Preferences userRoot() {        return new DisabledPreferences();    }    public static void install() {        try {            System.setProperty("java.util.prefs.PreferencesFactory",                       "edu.stanford.nlp.util.DisabledPreferencesFactory");	} catch (SecurityException e) {	    // oh well we couldn't do it...	}    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?