1 22 23 package org.xquark.xquery.typing; 24 25 import org.xquark.schema.Particle; 26 import org.xquark.schema.SimpleType; 27 import org.xquark.schema.Wildcard; 28 import org.xquark.xquery.parser.XQueryExpression; 29 30 public class ElementTools { 31 32 private static final String RCSRevision = "$Revision: 1.2 $"; 33 private static final String RCSName = "$Name: $"; 34 35 private int countSimpleType = 0; 36 private int countAttribute = 0; 37 private int countSimpleList = 0; 38 private int size = 0; 39 private boolean mixed = false; 40 private SimpleType simpleType = null; 41 private XQueryExpression name = null; 42 private Particle wildcard = null; 43 44 public ElementTools(int size, XQueryExpression name) 45 { 46 this.size = size; 47 this.name = name; 48 } 49 50 54 public int getCountSimpleType() { return countSimpleType; } 55 56 58 public int getCountAttribute() { return countAttribute; } 59 60 62 public int getCountSimpleList() { return countSimpleList; } 63 64 66 public int getSize() { return size; } 67 68 public void setSize(int size) { this.size = size; } 69 70 public boolean getMixed() { return mixed; } 71 72 public void setMixed(boolean mixed) { this.mixed = mixed; } 73 74 public SimpleType getSimpleType() { return simpleType; } 75 76 public void setSimpleType(SimpleType simpleType) { this.simpleType = simpleType; } 77 78 public XQueryExpression getName() { return name; } 79 80 public void setName(XQueryExpression name) { this.name = name; } 81 82 public void addWildCard(Particle wildcard) { 83 this.wildcard = wildcard; 84 } 85 public Particle getWildCard() { 86 return wildcard; 87 } 88 90 public void incSize() { size++; } 91 92 public void incCountSimpleType() { countSimpleType++; } 93 94 public void incCountAttribute() { countAttribute++; } 95 96 public void incCountSimpleList() { countSimpleList++; } 97 98 102 public String toString() 103 { 104 StringBuffer sb = new StringBuffer (); 105 sb.append("*** ElementTools ***\n"); 106 sb.append("countSimpleType: "+countSimpleType+"\n"); 107 sb.append("countAttribute: "+countAttribute+"\n"); 108 sb.append("countSimpleList: "+countSimpleList+"\n"); 109 sb.append("size: "+size+"\n"); 110 sb.append("mixed: "+mixed+"\n"); 111 sb.append("********************"); 112 return sb.toString(); 113 } 114 } 115 | Popular Tags |