Back to project page android-continuous-voice.
The source code is released under:
Copyright (c) 2015, Marius Fink - Universit?t Hamburg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...
If you think the Android project android-continuous-voice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.uniHamburg.informatik.continuousvoice.settings; //from www .java2 s .c om import java.util.ArrayList; import java.util.List; public class GeneralSettings { //defaults private Language language = Language.EnUs; private List<SettingsChangedListener> listeners = new ArrayList<SettingsChangedListener>(); private static GeneralSettings instance; public static GeneralSettings getInstance() { if (instance == null) { instance = new GeneralSettings(); } return instance; } private GeneralSettings() { //empty private constuctor for singleton } public Language getLanguage() { return language; } public void setLanguage(Language language) { this.language = language; notifyListeners(); } public void addSettingsChangedListener(SettingsChangedListener scl) { this.listeners.add(scl); } public void removeSettingsChangedListener(SettingsChangedListener scl) { this.listeners.remove(scl); } private void notifyListeners() { for (SettingsChangedListener scl: listeners) { scl.settingChanged(); } } }