KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > relaxng > impl > SingleDataDerivType


1 package com.thaiopensource.relaxng.impl;
2
3 import org.relaxng.datatype.ValidationContext;
4
5 /**
6  * DerivType for a Pattern whose derivative wrt any data is always the same.
7  */

8 class SingleDataDerivType extends DataDerivType {
9   private PatternMemo memo;
10
11   SingleDataDerivType() { }
12
13   PatternMemo dataDeriv(ValidatorPatternBuilder builder, Pattern p, String JavaDoc str, ValidationContext vc) {
14     if (memo == null)
15       memo = super.dataDeriv(builder, p, str, vc);
16     return memo;
17   }
18
19   DataDerivType copy() {
20     return new SingleDataDerivType();
21   }
22
23   DataDerivType combine(DataDerivType ddt) {
24     return ddt;
25   }
26 }
Popular Tags