1 57 58 package com.sun.org.apache.xerces.internal.impl.dtd.models; 59 60 61 66 public class CMAny 67 extends CMNode { 68 69 73 79 private int fType; 80 81 87 private String fURI; 88 89 94 private int fPosition = -1; 95 96 100 101 public CMAny(int type, String uri, int position) { 102 super(type); 103 104 fType = type; 106 fURI = uri; 107 fPosition = position; 108 } 109 110 114 final int getType() { 115 return fType; 116 } 117 118 final String getURI() { 119 return fURI; 120 } 121 122 final int getPosition() 123 { 124 return fPosition; 125 } 126 127 final void setPosition(int newPosition) 128 { 129 fPosition = newPosition; 130 } 131 132 136 138 public boolean isNullable() 139 { 140 return (fPosition == -1); 142 } 143 144 public String toString() 145 { 146 StringBuffer strRet = new StringBuffer (); 147 strRet.append("("); 148 strRet.append("##any:uri="); 149 strRet.append(fURI); 150 strRet.append(')'); 151 if (fPosition >= 0) 152 { 153 strRet.append 154 ( 155 " (Pos:" 156 + new Integer (fPosition).toString() 157 + ")" 158 ); 159 } 160 return strRet.toString(); 161 } 162 163 165 protected void calcFirstPos(CMStateSet toSet) 166 { 167 if (fPosition == -1) 169 toSet.zeroBits(); 170 171 else 173 toSet.setBit(fPosition); 174 } 175 176 protected void calcLastPos(CMStateSet toSet) 177 { 178 if (fPosition == -1) 180 toSet.zeroBits(); 181 182 else 184 toSet.setBit(fPosition); 185 } 186 187 } 189 | Popular Tags |