Changeset 9192


Ignore:
Timestamp:
2005-02-25T14:57:52+13:00 (19 years ago)
Author:
mdewsnip
Message:

Was using a Troolean unnecessarily.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/Subcollection.java

    r9184 r9192  
    2929import org.greenstone.gatherer.Gatherer;
    3030import org.greenstone.gatherer.util.StaticStrings;
    31 import org.greenstone.gatherer.util.Troolean;
    3231import org.greenstone.gatherer.util.XMLTools;
    3332import org.w3c.dom.*;
     
    4140    implements Comparable, DOMProxyListEntry {
    4241    /** A <i>boolean</i> which is <i>true</i> if the condition is an include one, <i>false</i> otherwise. */
    43     private Troolean include = new Troolean();
     42    private boolean include = true;
    4443    /** The DOM Element this Subcollection is based upon. */
    4544    private Element element = null;
     
    7574    // Cache the details
    7675    this.flags = flags;
    77     this.include.set(include);
     76    this.include = include;
    7877    this.name = name;
    7978    this.pattern = pattern;
     
    179178     */
    180179    public boolean isInclusive() {
    181     if(!include.isDecided() && element != null) {
    182         include.set(element.getAttribute(StaticStrings.TYPE_ATTRIBUTE).equals(StaticStrings.INCLUDE_STR));
    183     }
    184     return include.isTrue();
     180    if (element != null) {
     181        include = element.getAttribute(StaticStrings.TYPE_ATTRIBUTE).equals(StaticStrings.INCLUDE_STR);
     182    }
     183
     184    return include;
    185185    }
    186186
     
    193193    public void setElement(Element element) {
    194194    this.element = element;
    195     include.reset();
     195    include = true;
    196196    flags = null;
    197197    name = null;
     
    213213    if(element != null) {
    214214        // Change element
    215         element.setAttribute(StaticStrings.TYPE_ATTRIBUTE, (new_include ? StaticStrings.INCLUDE_STR : StaticStrings.EXCLUDE_STR));
    216         include.set(new_include);
     215        include = new_include;
     216        element.setAttribute(StaticStrings.TYPE_ATTRIBUTE, (include ? StaticStrings.INCLUDE_STR : StaticStrings.EXCLUDE_STR));
    217217        text = null;
    218218    }
Note: See TracChangeset for help on using the changeset viewer.