00001 package edu.tum.cs.srldb.datadict.domain; 00002 00003 import java.io.Serializable; 00004 00005 import kdl.prox3.dbmgr.DataTypeEnum; 00006 00007 public abstract class Domain<T> implements Serializable { 00008 protected String name; 00009 00010 public Domain(String name) { 00011 this.name = name; 00012 } 00013 00014 public String getName() { 00015 return name; 00016 } 00017 00018 public abstract boolean contains(T value); 00019 public abstract boolean containsString(String value); 00020 public abstract boolean isFinite(); 00021 public abstract String[] getValues(); 00022 public abstract DataTypeEnum getType(); 00023 00024 public String toString() { 00025 StringBuffer buf = new StringBuffer("{"); 00026 int i = 0; 00027 for(String value : getValues()) { 00028 if(i++ > 0) buf.append(", "); 00029 buf.append(value); 00030 } 00031 buf.append("}"); 00032 return buf.toString(); 00033 } 00034 }