protected Collection getKeysOfType(int elementType) {

    LinkedList keys = (LinkedList) super.getKeysOfType(elementType);
    LinkedList temp = null;

    if ((elementType & PatternFilter.PROPERTY) != 0) {
      temp = new LinkedList();
      temp.addAll(patternAnalyser.getPropertyPatterns());
      Collections.sort(temp, new PatternComparator());
      keys.addAll(temp);
      // keys.addAll( patternAnalyser.getPropertyPatterns() );
    }
    if ((elementType & PatternFilter.IDXPROPERTY) != 0) {
      temp = new LinkedList();
      temp.addAll(patternAnalyser.getIdxPropertyPatterns());
      Collections.sort(temp, new PatternComparator());
      keys.addAll(temp);
      // keys.addAll( patternAnalyser.getIdxPropertyPatterns() );
    }
    if ((elementType & PatternFilter.EVENT_SET) != 0) {
      temp = new LinkedList();
      temp.addAll(patternAnalyser.getEventSetPatterns());
      Collections.sort(temp, new PatternComparator());
      keys.addAll(temp);
      // keys.addAll( patternAnalyser.getEventSetPatterns() );
    }

    //    if ((filter == null) || filter.isSorted ())
    //      Collections.sort (keys, comparator);
    return keys;
  }
  /** Updates all the keys with given filter. Overriden to provide package access tothis method. */
  protected void refreshKeys(int filter) {

    // Method is added or removed ve have to re-analyze the pattern abd to
    // registrate Children as listener

    reassignMethodListener();
    reassignFieldListener();
    patternAnalyser.analyzeAll();
    super.refreshKeys(filter);
    // Thread.dumpStack();
  }