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:
012: //project specific classes
013:
014: //other classes
015:
016: public class SelectionCriteriaForConceptTag extends
017: BaseAppraiseConceptTagContext {
018:
019: //
020: //private ConceptTagFlags ctf = null;
021: private String ctClass = null;
022: private boolean autoValidate = false;
023:
024: //
025: //
026: protected SelectionCriteriaForConceptTag(ConceptTag inCt) {
027: super (null, null);
028: this .ctClass = inCt.getClass().getName();
029: //this.ctf = new ConceptTagFlags();
030: }
031:
032: public final static SelectionCriteriaForConceptTag newInstance(
033: ConceptTag inCt) {
034: //
035: SelectionCriteriaForConceptTag outValue = null;
036:
037: if (inCt instanceof ReturnableConceptTag) {
038: outValue = new SelectionCriteriaForReturnableConceptTag(
039: inCt);
040: } else {
041: outValue = new SelectionCriteriaForConceptTag(inCt);
042: }
043:
044: return outValue;
045: }
046:
047: //
048: //
049: //
050: public int hashCode() {
051:
052: int outValue = 0;
053:
054: outValue += this .ctClass.hashCode();
055: if (this .autoValidate) {
056: outValue += 1;
057: }
058: outValue += super .hashCode();
059:
060: return outValue;
061: }
062:
063: public boolean equals(Object inObj) {
064:
065: boolean outValue = true;
066:
067: if (inObj instanceof SelectionCriteriaForConceptTag) {
068: SelectionCriteriaForConceptTag scfct1 = ((SelectionCriteriaForConceptTag) inObj);
069: outValue &= (this .ctClass.equals(scfct1.ctClass));
070: outValue &= (this .autoValidate == scfct1.autoValidate);
071: outValue &= (super .equals(scfct1));
072: } else {
073: outValue &= false;
074: }
075:
076: return outValue;
077: }
078:
079: //
080: //
081: //
082: public boolean isInitialized() {
083: return (true);
084: }
085:
086: public String getCtClassName() {
087: return this .ctClass;
088: }
089:
090: //
091: public boolean isAutoValidateForTemplateInterface() {
092: return this .autoValidate;
093: }
094:
095: public void setAutoValidateForTemplateInterface(
096: boolean inAutoValidate) {
097: this .autoValidate = inAutoValidate;
098: }
099:
100: //public ConceptTagFlags getFlags() {
101: // return this.ctf;
102: //}
103: }
|