1 16 17 package org.apache.xerces.impl.dtd.models; 18 19 26 public abstract class CMNode 27 { 28 public CMNode(int type) 32 { 33 fType = type; 34 } 35 36 37 public abstract boolean isNullable() ; 42 43 44 public final int type() 48 { 49 return fType; 50 } 51 52 public final CMStateSet firstPos() 54 { 55 if (fFirstPos == null) 56 { 57 fFirstPos = new CMStateSet(fMaxStates); 58 calcFirstPos(fFirstPos); 59 } 60 return fFirstPos; 61 } 62 63 public final CMStateSet lastPos() 65 { 66 if (fLastPos == null) 67 { 68 fLastPos = new CMStateSet(fMaxStates); 69 calcLastPos(fLastPos); 70 } 71 return fLastPos; 72 } 73 74 final void setFollowPos(CMStateSet setToAdopt) 75 { 76 fFollowPos = setToAdopt; 77 } 78 79 public final void setMaxStates(int maxStates) 80 { 81 fMaxStates = maxStates; 82 } 83 84 85 protected abstract void calcFirstPos(CMStateSet toSet) ; 89 90 protected abstract void calcLastPos(CMStateSet toSet) ; 91 92 93 private int fType; 124 private CMStateSet fFirstPos = null; 125 private CMStateSet fFollowPos = null; 126 private CMStateSet fLastPos = null; 127 private int fMaxStates = -1; 128 }; 129 130 131 | Popular Tags |