00001 package edu.tum.cs.srldb.datadict.domain; 00002 00003 public class BooleanDomain extends OrderedStringDomain { 00004 private static final long serialVersionUID = 1L; 00005 protected static BooleanDomain singleton = null; 00006 00007 public static BooleanDomain getInstance() { 00008 if(singleton == null) 00009 singleton = new BooleanDomain(); 00010 return singleton; 00011 } 00012 00013 protected BooleanDomain() { 00014 super("bool", new String[]{"true", "false"}); 00015 } 00016 00017 public boolean isTrue(String value) { 00018 return value.equalsIgnoreCase(this.values[0]); 00019 } 00020 00021 public boolean isFalse(String value) { 00022 return !isTrue(value); 00023 } 00024 00025 public boolean containsString(String s) { 00026 return containsIgnoreCase(s); 00027 } 00028 }