From 7815209c7bfa1a49622c105a18e4717508f9710e Mon Sep 17 00:00:00 2001 From: micha3lp Date: Sat, 19 Aug 2006 04:42:06 +0000 Subject: [PATCH] class used to hold dictionary settings --- .../thdl/tib/input/DictionarySettings.java | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 source/org/thdl/tib/input/DictionarySettings.java diff --git a/source/org/thdl/tib/input/DictionarySettings.java b/source/org/thdl/tib/input/DictionarySettings.java new file mode 100644 index 0000000..d3b15c4 --- /dev/null +++ b/source/org/thdl/tib/input/DictionarySettings.java @@ -0,0 +1,93 @@ +/** + * + * + */ + +package org.thdl.tib.input ; + +public class DictionarySettings +{ + private boolean dictionaryValid = false ; + private boolean dictionaryEnabled = false ; + private boolean dictionaryLocal = false ; + private String dictionaryPath = "" ; + + public DictionarySettings () + { + boolean dictionaryValid = false ; + boolean dictionaryEnabled = false ; + boolean dictionaryLocal = false ; + String dictionaryPath = "" ; + } + + public DictionarySettings ( boolean valid, boolean enabled, boolean local, String pathOrUrl ) + { + boolean dictionaryValid = valid ; + boolean dictionaryEnabled = enabled ; + boolean dictionaryLocal = local ; + String dictionaryPath = pathOrUrl ; + } + + public DictionarySettings ( boolean enabled, boolean local, String pathOrUrl ) + { + boolean dictionaryValid = true ; + boolean dictionaryEnabled = enabled ; + boolean dictionaryLocal = local ; + String dictionaryPath = pathOrUrl ; + } + + public boolean equal ( DictionarySettings ds ) + { + return ( ds.isEnabled () == this.isEnabled () && + ds.isLocal () != this.isLocal () && + ds.getPathOrUrl ().equals ( this.getPathOrUrl () ) ) ; + } + + public boolean isValid () + { + return dictionaryValid ; + } + + public boolean isEnabled () + { + return dictionaryEnabled ; + } + + public boolean isLocal () + { + return dictionaryLocal ; + } + + public String getPathOrUrl () + { + return dictionaryPath ; + } + + public void set ( DictionarySettings ds ) + { + dictionaryValid = ds.dictionaryValid ; + dictionaryEnabled = ds.dictionaryEnabled ; + dictionaryLocal = ds.dictionaryLocal ; + dictionaryPath = ds.dictionaryPath ; + } + + public void setValid ( boolean valid ) + { + dictionaryValid = valid ; + } + + public void setEnabled ( boolean enabled ) + { + dictionaryEnabled = enabled ; + } + + public void setLocal ( boolean local ) + { + dictionaryLocal = local ; + } + + public void setPathOrUrl ( String pathOrUrl ) + { + dictionaryPath = pathOrUrl ; + } +};