1 16 17 package org.apache.xerces.impl.dtd.models; 18 19 20 27 public class CMAny 28 extends CMNode { 29 30 34 40 private int fType; 41 42 48 private String fURI; 49 50 55 private int fPosition = -1; 56 57 61 62 public CMAny(int type, String uri, int position) { 63 super(type); 64 65 fType = type; 67 fURI = uri; 68 fPosition = position; 69 } 70 71 75 final int getType() { 76 return fType; 77 } 78 79 final String getURI() { 80 return fURI; 81 } 82 83 final int getPosition() 84 { 85 return fPosition; 86 } 87 88 final void setPosition(int newPosition) 89 { 90 fPosition = newPosition; 91 } 92 93 97 99 public boolean isNullable() 100 { 101 return (fPosition == -1); 103 } 104 105 public String toString() 106 { 107 StringBuffer strRet = new StringBuffer (); 108 strRet.append("("); 109 strRet.append("##any:uri="); 110 strRet.append(fURI); 111 strRet.append(')'); 112 if (fPosition >= 0) 113 { 114 strRet.append 115 ( 116 " (Pos:" 117 + Integer.toString(fPosition) 118 + ")" 119 ); 120 } 121 return strRet.toString(); 122 } 123 124 126 protected void calcFirstPos(CMStateSet toSet) 127 { 128 if (fPosition == -1) 130 toSet.zeroBits(); 131 132 else 134 toSet.setBit(fPosition); 135 } 136 137 protected void calcLastPos(CMStateSet toSet) 138 { 139 if (fPosition == -1) 141 toSet.zeroBits(); 142 143 else 145 toSet.setBit(fPosition); 146 } 147 148 } 150 | Popular Tags |