1 57 58 package com.sun.org.apache.xerces.internal.impl.dtd.models; 59 60 65 public abstract class CMNode 66 { 67 public CMNode(int type) 71 { 72 fType = type; 73 } 74 75 76 public abstract boolean isNullable() ; 81 82 83 public final int type() 87 { 88 return fType; 89 } 90 91 public final CMStateSet firstPos() 93 { 94 if (fFirstPos == null) 95 { 96 fFirstPos = new CMStateSet(fMaxStates); 97 calcFirstPos(fFirstPos); 98 } 99 return fFirstPos; 100 } 101 102 public final CMStateSet lastPos() 104 { 105 if (fLastPos == null) 106 { 107 fLastPos = new CMStateSet(fMaxStates); 108 calcLastPos(fLastPos); 109 } 110 return fLastPos; 111 } 112 113 final void setFollowPos(CMStateSet setToAdopt) 114 { 115 fFollowPos = setToAdopt; 116 } 117 118 public final void setMaxStates(int maxStates) 119 { 120 fMaxStates = maxStates; 121 } 122 123 124 protected abstract void calcFirstPos(CMStateSet toSet) ; 128 129 protected abstract void calcLastPos(CMStateSet toSet) ; 130 131 132 private int fType; 163 private CMStateSet fFirstPos = null; 164 private CMStateSet fFollowPos = null; 165 private CMStateSet fLastPos = null; 166 private int fMaxStates = -1; 167 }; 168 169 170 | Popular Tags |