1 22 23 package org.xquark.schema; 24 25 import java.util.HashSet ; 26 27 public final class Facet implements Cloneable { 28 private static final String RCSRevision = "$Revision: 1.1 $"; 29 private static final String RCSName = "$Name: $"; 30 String name; 31 String value; 32 boolean fixed = false; 33 34 HashSet enumFacets = new HashSet (); 36 37 public Facet(String name, String value, String fixed) { 39 this.name = name; 40 this.value = value; 41 if ( "true".equals(fixed) ) this.fixed = true; 42 } 43 44 Facet(String name) { 46 this.name = name; 47 } 48 49 public Object clone() throws CloneNotSupportedException { 50 Facet result = null; 51 result = (Facet)super.clone(); 52 result.enumFacets = new HashSet (); 53 java.util.Iterator it = enumFacets.iterator(); 54 while ( it.hasNext() ) { 55 String value = new String ((String )it.next()); 56 result.enumFacets.add(value); 57 } 58 return result; 59 } 60 61 public void addFacet(String value) { 63 enumFacets.add(value); 64 } 65 66 public void setFacet(String name, String value, String fixed) { 67 this.name = name; 68 this.value = value; 69 if ( "true".equals(fixed) ) this.fixed = true; 70 } 71 72 public void setValue(String value) { 73 this.value = value; 74 } 75 76 public String getName() { 77 return this.name; 78 } 79 80 public String getValue() { 81 return this.value; 82 } 83 84 public boolean isFixed() { 85 return this.fixed; 86 } 87 88 public HashSet getEnumFacets() { 89 return enumFacets; 90 } 91 92 public String toString() { 93 return this.name; 94 } 95 96 } 97 | Popular Tags |