jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
author joehw
Thu, 12 Apr 2012 08:38:26 -0700
changeset 12457 c348e06f0e82
parent 6 jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltSets.java@7f561c08de6b
permissions -rw-r--r--
7160496: Rename JDK8 JAXP source directory Summary: moving src/share/classes to src Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 1999-2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: ExsltSets.java,v 1.1.2.1 2005/08/01 02:08:50 jeffsuttor Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
package com.sun.org.apache.xalan.internal.lib;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import java.util.Hashtable;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import com.sun.org.apache.xml.internal.utils.DOMHelper;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import com.sun.org.apache.xpath.internal.NodeSet;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import org.w3c.dom.NodeList;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * This class contains EXSLT set extension functions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * It is accessed by specifying a namespace URI as follows:
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * <pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *    xmlns:set="http://exslt.org/sets"
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * </pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * The documentation for each function has been copied from the relevant
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * EXSLT Implementer page.
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * @xsl.usage general
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
public class ExsltSets extends ExsltBase
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
   * The set:leading function returns the nodes in the node set passed as the first argument that
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
   * precede, in document order, the first node in the node set passed as the second argument. If
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
   * the first node in the second node set is not contained in the first node set, then an empty
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
   * node set is returned. If the second node set is empty, then the first node set is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
   * @param nl1 NodeList for first node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
   * @param nl2 NodeList for second node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
   * @return a NodeList containing the nodes in nl1 that precede in document order the first
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
   * node in nl2; an empty node-set if the first node in nl2 is not in nl1; all of nl1 if nl2
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
   * is empty.
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
   * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
  public static NodeList leading (NodeList nl1, NodeList nl2)
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
    if (nl2.getLength() == 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
      return nl1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
    NodeSet ns1 = new NodeSet(nl1);
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
    NodeSet leadNodes = new NodeSet();
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    Node endNode = nl2.item(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
    if (!ns1.contains(endNode))
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
      return leadNodes; // empty NodeSet
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
    for (int i = 0; i < nl1.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
      Node testNode = nl1.item(i);
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
      if (DOMHelper.isNodeAfter(testNode, endNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
          && !DOMHelper.isNodeTheSame(testNode, endNode))
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
        leadNodes.addElement(testNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
    return leadNodes;
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
   * The set:trailing function returns the nodes in the node set passed as the first argument that
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
   * follow, in document order, the first node in the node set passed as the second argument. If
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
   * the first node in the second node set is not contained in the first node set, then an empty
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
   * node set is returned. If the second node set is empty, then the first node set is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
   * @param nl1 NodeList for first node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
   * @param nl2 NodeList for second node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
   * @return a NodeList containing the nodes in nl1 that follow in document order the first
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   * node in nl2; an empty node-set if the first node in nl2 is not in nl1; all of nl1 if nl2
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
   * is empty.
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
   * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
  public static NodeList trailing (NodeList nl1, NodeList nl2)
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    if (nl2.getLength() == 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
      return nl1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
    NodeSet ns1 = new NodeSet(nl1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
    NodeSet trailNodes = new NodeSet();
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
    Node startNode = nl2.item(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
    if (!ns1.contains(startNode))
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
      return trailNodes; // empty NodeSet
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
    for (int i = 0; i < nl1.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
      Node testNode = nl1.item(i);
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
      if (DOMHelper.isNodeAfter(startNode, testNode)
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
          && !DOMHelper.isNodeTheSame(startNode, testNode))
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
        trailNodes.addElement(testNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
    return trailNodes;
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
   * The set:intersection function returns a node set comprising the nodes that are within
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
   * both the node sets passed as arguments to it.
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
   * @param nl1 NodeList for first node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
   * @param nl2 NodeList for second node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
   * @return a NodeList containing the nodes in nl1 that are also
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
   * in nl2.
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
   * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
  public static NodeList intersection(NodeList nl1, NodeList nl2)
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
    NodeSet ns1 = new NodeSet(nl1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
    NodeSet ns2 = new NodeSet(nl2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
    NodeSet inter = new NodeSet();
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
    inter.setShouldCacheNodes(true);
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
    for (int i = 0; i < ns1.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
      Node n = ns1.elementAt(i);
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
      if (ns2.contains(n))
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
        inter.addElement(n);
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
    return inter;
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
   * The set:difference function returns the difference between two node sets - those nodes that
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
   * are in the node set passed as the first argument that are not in the node set passed as the
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
   * second argument.
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
   * @param nl1 NodeList for first node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
   * @param nl2 NodeList for second node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
   * @return a NodeList containing the nodes in nl1 that are not in nl2.
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
   * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
  public static NodeList difference(NodeList nl1, NodeList nl2)
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
    NodeSet ns1 = new NodeSet(nl1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
    NodeSet ns2 = new NodeSet(nl2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
    NodeSet diff = new NodeSet();
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
    diff.setShouldCacheNodes(true);
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
    for (int i = 0; i < ns1.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
      Node n = ns1.elementAt(i);
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
      if (!ns2.contains(n))
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
        diff.addElement(n);
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
    return diff;
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
   * The set:distinct function returns a subset of the nodes contained in the node-set NS passed
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
   * as the first argument. Specifically, it selects a node N if there is no node in NS that has
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
   * the same string value as N, and that precedes N in document order.
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
   * @param nl NodeList for the node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
   * @return a NodeList with nodes from nl containing distinct string values.
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
   * In other words, if more than one node in nl contains the same string value,
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
   * only include the first such node found.
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
   * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
  public static NodeList distinct(NodeList nl)
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
    NodeSet dist = new NodeSet();
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
    dist.setShouldCacheNodes(true);
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
    Hashtable stringTable = new Hashtable();
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
    for (int i = 0; i < nl.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
      Node currNode = nl.item(i);
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
      String key = toString(currNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
      if (key == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
        dist.addElement(currNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
      else if (!stringTable.containsKey(key))
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
      {
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
        stringTable.put(key, currNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
        dist.addElement(currNode);
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
      }
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
    return dist;
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
   * The set:has-same-node function returns true if the node set passed as the first argument shares
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
   * any nodes with the node set passed as the second argument. If there are no nodes that are in both
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
   * node sets, then it returns false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
   * The Xalan extensions MethodResolver converts 'has-same-node' to 'hasSameNode'.
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
   * Note: Not to be confused with hasSameNodes in the Xalan namespace, which returns true if
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
   * the two node sets contain the exactly the same nodes (perhaps in a different order),
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
   * otherwise false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
   * @see <a href="http://www.exslt.org/">EXSLT</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
  public static boolean hasSameNode(NodeList nl1, NodeList nl2)
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
    NodeSet ns1 = new NodeSet(nl1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
    NodeSet ns2 = new NodeSet(nl2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
    for (int i = 0; i < ns1.getLength(); i++)
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
      if (ns2.contains(ns1.elementAt(i)))
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
        return true;
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
    return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
}