001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.common.tagging;
009:
010: //base classes
011: import java.util.ArrayList;
012: import java.util.HashMap;
013:
014: //project specific classes
015:
016: //other classes
017:
018: public class CompoundConceptTagConstraintContext extends
019: AbstractConceptTagConstraintContext {
020:
021: //
022: private ArrayList ctcontArray = null;
023: private HashMap ctcontMap = null;
024: //
025: private ArrayList preIterPivList = null;
026: private ArrayList postIterPivList = null;
027:
028: private CompoundConceptTagConstraintContext(
029: ConceptTagConstraintOrTemplate inCtcot) {
030:
031: super (inCtcot);
032: //
033: this .ctcontArray = new ArrayList();
034: this .ctcontMap = new HashMap();
035: //
036: this .preIterPivList = new ArrayList();
037: this .postIterPivList = new ArrayList();
038: }
039:
040: public final static CompoundConceptTagConstraintContext newInstance(
041: ConceptTagConstraintOrTemplate inCtcot) {
042:
043: CompoundConceptTagConstraintContext outValue = null;
044:
045: //if (!inCtcot.getPreferences().isValidateOnlyMode()) {
046: outValue = new CompoundConceptTagConstraintContext(inCtcot);
047: //}
048: //else {
049: // outValue = inCtcot.getCompoundContext();
050: //}
051:
052: return outValue;
053: }
054:
055: //
056: public int getTemplateCount() {
057: return this .ctcontArray.size();
058: }
059:
060: protected ConceptTagConstraintTemplate getTemplate(String inName) {
061:
062: ConceptTagConstraintTemplate outValue = null;
063:
064: Object o = this .ctcontMap.get(inName);
065: outValue = (ConceptTagConstraintTemplate) o;
066:
067: return outValue;
068: }
069:
070: public ConceptTagConstraintTemplate getTemplate(int inIndex) {
071:
072: ConceptTagConstraintTemplate outValue = null;
073:
074: Object o = this .ctcontArray.get(inIndex);
075: outValue = (ConceptTagConstraintTemplate) o;
076:
077: return outValue;
078: }
079:
080: public void addDefaultValue() {
081: getConstraintOrTemplate().addDefaultValue(this );
082: }
083:
084: public void registerTemplate(ConceptTagConstraintTemplate inCtcont) {
085: this .ctcontArray.add(inCtcont);
086: this .ctcontMap.put(inCtcont.getName(), inCtcont);
087: }
088:
089: //
090: //
091: public void registerPreIterativeValidator(
092: PreIterValForCompoundConceptTagConContext inPivfcctcc) {
093: //
094: this .preIterPivList.add(inPivfcctcc);
095: }
096:
097: public int getPreValidateCount() {
098: return this .preIterPivList.size();
099: }
100:
101: public PreIterValForCompoundConceptTagConContext getPreValidate(
102: int inIndex) {
103: //
104: PreIterValForCompoundConceptTagConContext outValue = null;
105:
106: Object o = this .preIterPivList.get(inIndex);
107:
108: outValue = ((PreIterValForCompoundConceptTagConContext) o);
109:
110: return outValue;
111: }
112: //
113: //
114: /*
115: public void registerPostIterativeValidator(
116: PostIterValForCompoundConceptTagConContext inPivfcctcc) {
117: //
118: this.postIterPivList.add(inPivfcctcc);
119: }
120: public int getPostValidateCount() {
121: return this.postIterPivList.size();
122: }
123: public PostIterValForCompoundConceptTagConContext getPostValidate(
124: int inIndex) {
125: //
126: PostIterValForCompoundConceptTagConContext outValue = null;
127:
128: Object o = this.postIterPivList.get(inIndex);
129:
130: outValue = ((PostIterValForCompoundConceptTagConContext)o);
131:
132: return outValue;
133: }
134: */
135: //protected ArrayList getTemplates() {
136: // return this.ctcontArray;
137: //}
138: }
|