1 57 58 package org.enhydra.apache.xerces.validators.common; 59 60 64 public abstract class CMNode 65 { 66 CMNode(int type) throws CMException 70 { 71 fType = type; 72 } 73 74 75 abstract boolean isNullable() throws CMException; 79 80 81 final int type() 85 { 86 return fType; 87 } 88 89 final CMStateSet firstPos() throws CMException 90 { 91 if (fFirstPos == null) 92 { 93 fFirstPos = new CMStateSet(fMaxStates); 94 calcFirstPos(fFirstPos); 95 } 96 return fFirstPos; 97 } 98 99 final CMStateSet lastPos() throws CMException 100 { 101 if (fLastPos == null) 102 { 103 fLastPos = new CMStateSet(fMaxStates); 104 calcLastPos(fLastPos); 105 } 106 return fLastPos; 107 } 108 109 final void setFollowPos(CMStateSet setToAdopt) 110 { 111 fFollowPos = setToAdopt; 112 } 113 114 final void setMaxStates(int maxStates) 115 { 116 fMaxStates = maxStates; 117 } 118 119 120 protected abstract void calcFirstPos(CMStateSet toSet) throws CMException; 124 125 protected abstract void calcLastPos(CMStateSet toSet) throws CMException; 126 127 128 private int fType; 159 private CMStateSet fFirstPos = null; 160 private CMStateSet fFollowPos = null; 161 private CMStateSet fLastPos = null; 162 private int fMaxStates = -1; 163 }; 164 | Popular Tags |