Dictionary.java

  1. /**
  2. * Copyright 2010,2021 Nikolas S Boyd.
  3. Permission is granted to copy this work provided this copyright statement is retained in all copies.

  4. */
  5. package Hoot.Collections;

  6. import Hoot.Runtime.Functions.*;
  7. import Hoot.Runtime.Faces.*;
  8. import Hoot.Runtime.Values.*;
  9. import Hoot.Runtime.Blocks.*;
  10. import Smalltalk.Core.*;
  11. import Smalltalk.Blocks.*;
  12. import Smalltalk.Magnitudes.*;
  13. import Hoot.Behaviors.*;
  14. import Hoot.Behaviors.Nil;
  15. import Hoot.Behaviors.Object;
  16. import Hoot.Behaviors.True;
  17. import Hoot.Behaviors.False;
  18. import Hoot.Behaviors.Boolean;
  19. import Hoot.Magnitudes.*;
  20. import Hoot.Magnitudes.Integer;
  21. import Hoot.Magnitudes.Character;
  22. import Hoot.Magnitudes.Float;
  23. import Hoot.Magnitudes.Double;
  24. import Hoot.Magnitudes.Integer;
  25. import Hoot.Streams.WriteStream;
  26. import Hoot.Runtime.Names.Primitive;
  27. import Smalltalk.Core.Posit;
  28. import Smalltalk.Core.Subject;
  29. import Smalltalk.Collections.*;
  30. import Smalltalk.Magnitudes.Ordinal;
  31. import Smalltalk.Magnitudes.Scalar;
  32. import Smalltalk.Magnitudes.Associated;

  33. public class Dictionary<KeyType extends Object, ElementType extends Object> extends Collection<ElementType> implements CollectedDictionary<KeyType, ElementType>
  34. {

  35.   public static Metaclass type() { return (Metaclass)Metaclass.$class; }
  36.   @Override public Metaclass $class() { return (Metaclass)Metaclass.$class; }
  37.   public static class Metaclass extends Collection.Metaclass implements CollectedDictionary.Metatype
  38.   {
  39.     static final Dictionary.Metaclass $class = new Dictionary.Metaclass();
  40.     public Metaclass() {
  41.       this(Dictionary.Metaclass.class);
  42.     }

  43.     public Metaclass(java.lang.Class aClass) {
  44.       super(aClass);
  45.     }

  46.     @Override public java.lang.Class outerClass() { return Dictionary.class; }


  47.     /**
  48.      * @return
  49.      */
  50.     @Override public   Dictionary $new()
  51.     {
  52.       java.lang.String exitID = "DictionaryMetatype>>$new";
  53.       Frame f0 = new Frame(exitID);
  54.       return (Dictionary)this.$new(SmallInteger.from(10));
  55.     }

  56.     /**
  57.      * @return
  58.      */
  59.     @Override public   Dictionary $new(final Ordinal capacity)
  60.     {
  61.       java.lang.String exitID = "DictionaryMetatype>>$new";
  62.       Frame f0 = new Frame(exitID);
  63.       return (Dictionary)new Dictionary(capacity);
  64.     }

  65.     /**
  66.      * @return
  67.      */
  68.     public   Dictionary withAll(final CollectedDictionary pairedElements)
  69.     {
  70.       java.lang.String exitID = "DictionaryMetatype>>withAll";
  71.       Frame f0 = new Frame(exitID);
  72.       Dictionary results = this.$new(pairedElements.size());
  73.       pairedElements.keysAndValuesDo(Closure.with(f2 -> {
  74.         Object key = f2.getValue(0).value();
  75.         Object value = f2.getValue(1).value();
  76.         results.at_put(key, value);
  77.       }, "key", "value"));
  78.       return (Dictionary)results;
  79.     }

  80.     /**
  81.      * @return
  82.      */
  83.     public   Dictionary from(final java.util.Map primitiveMap)
  84.     {
  85.       java.lang.String exitID = "DictionaryMetatype>>from";
  86.       Frame f0 = new Frame(exitID);
  87.       return (Dictionary)new Dictionary(primitiveMap);
  88.     }

  89.     /**
  90.      * @return
  91.      */
  92.     public   Dictionary synchronizedFrom(final java.util.Map primitiveMap)
  93.     {
  94.       java.lang.String exitID = "DictionaryMetatype>>synchronizedFrom";
  95.       Frame f0 = new Frame(exitID);
  96.       return (Dictionary)this.from(primitiveMap);
  97.     }
  98.   }


  99.   protected java.util.Map<KeyType, ElementType> contents;

  100.   /**
  101.    *
  102.    */
  103.   protected    Dictionary()
  104.   {
  105.     this(new java.util.HashMap());
  106.     java.lang.String exitID = "Dictionary>>Dictionary";
  107.     Frame f0 = new Frame(exitID);
  108.   }

  109.   /**
  110.    *
  111.    */
  112.   protected    Dictionary(final Ordinal capacity)
  113.   {
  114.     this(new java.util.HashMap(capacity.intValue()));
  115.     java.lang.String exitID = "Dictionary>>Dictionary";
  116.     Frame f0 = new Frame(exitID);
  117.   }

  118.   /**
  119.    *
  120.    */
  121.   protected    Dictionary(final java.util.Map primitiveMap)
  122.   {
  123.     java.lang.String exitID = "Dictionary>>Dictionary";
  124.     Frame f0 = new Frame(exitID);
  125.     contents=java.util.Collections.synchronizedMap(primitiveMap);
  126.   }

  127.   /**
  128.    * @return
  129.    */
  130.   public   java.util.Map primitiveContents()
  131.   {
  132.     java.lang.String exitID = "Dictionary>>primitiveContents";
  133.     Frame f0 = new Frame(exitID);
  134.     return (java.util.Map)contents;
  135.   }

  136.   /**
  137.    * @return
  138.    */
  139.   @Override public   Integer size()
  140.   {
  141.     java.lang.String exitID = "Dictionary>>size";
  142.     Frame f0 = new Frame(exitID);
  143.     return (Integer)SmallInteger.from(contents.size());
  144.   }

  145.   /**
  146.    * @return
  147.    */
  148.   public   Set<KeyType> keys()
  149.   {
  150.     java.lang.String exitID = "Dictionary>>keys";
  151.     Frame f0 = new Frame(exitID);
  152.     return (Set<KeyType>)Set.from(contents.keySet());
  153.   }

  154.   /**
  155.    * @return
  156.    */
  157.   public   KeyType indexOf(final ElementType element)
  158.   {
  159.     java.lang.String exitID = "Dictionary>>indexOf";
  160.     Frame f0 = new Frame(exitID);
  161.     return (KeyType)this.indexOf_ifAbsent(element, Closure.with(f2 -> {
  162.       this.elementNotFound();
  163.     return Nil.literal();
  164.     }, ""));
  165.   }

  166.   /**
  167.    * @return
  168.    */
  169.   public   KeyType indexOf_ifAbsent(final ElementType element, final NiladicValuable aBlock)
  170.   {
  171.     java.lang.String exitID = "Dictionary>>indexOf_ifAbsent";
  172.     Frame f0 = new Frame(exitID);
  173.     KeyType key = Primitive.findKey(element, contents);
  174.     return (KeyType)(Boolean.primitiveValue((key == null)) ? aBlock.value() : key);
  175.   }

  176.   /**
  177.    * @return
  178.    */
  179.   public   KeyType keyAtValue(final ElementType element)
  180.   {
  181.     java.lang.String exitID = "Dictionary>>keyAtValue";
  182.     Frame f0 = new Frame(exitID);
  183.     return (KeyType)this.indexOf(element);
  184.   }

  185.   /**
  186.    * @return
  187.    */
  188.   public   KeyType keyAtValue_ifAbsent(final ElementType element, final NiladicValuable aBlock)
  189.   {
  190.     java.lang.String exitID = "Dictionary>>keyAtValue_ifAbsent";
  191.     Frame f0 = new Frame(exitID);
  192.     return (KeyType)this.indexOf_ifAbsent(element, aBlock);
  193.   }

  194.   /**
  195.    * @return
  196.    */
  197.   public   ElementType at(final KeyType index)
  198.   {
  199.     java.lang.String exitID = "Dictionary>>at";
  200.     Frame f0 = new Frame(exitID);
  201.     if (contents.containsKey(index)) {
  202.       return contents.get(index);
  203.     };
  204.     this.elementNotFound();
  205.     return (ElementType)null;
  206.   }

  207.   /**
  208.    * @return
  209.    */
  210.   public   ElementType at_ifAbsent(final KeyType index, final NiladicValuable aBlock)
  211.   {
  212.     java.lang.String exitID = "Dictionary>>at_ifAbsent";
  213.     Frame f0 = new Frame(exitID);
  214.     if (contents.containsKey(index)) {
  215.       return contents.get(index);
  216.     };
  217.     return (ElementType)aBlock.value();
  218.   }

  219.   /**
  220.    * @return
  221.    */
  222.   public   ElementType at_ifAbsentPut(final KeyType index, final NiladicValuable aBlock)
  223.   {
  224.     java.lang.String exitID = "Dictionary>>at_ifAbsentPut";
  225.     Frame f0 = new Frame(exitID);
  226.     return (ElementType)this.at_ifAbsent(index, Closure.with(f2 -> {
  227.       return this.at_put(index, aBlock.value());
  228.     }, ""));
  229.   }

  230.   /**
  231.    * @return
  232.    */
  233.   public   ElementType at_put(final KeyType index, final ElementType element)
  234.   {
  235.     java.lang.String exitID = "Dictionary>>at_put";
  236.     Frame f0 = new Frame(exitID);
  237.     contents.put(index, element);
  238.     return (ElementType)element;
  239.   }

  240.   /**
  241.    * @return
  242.    */
  243.   public   ElementType atAll_put(final CollectedDistinctly<KeyType> indices, final ElementType element)
  244.   {
  245.     java.lang.String exitID = "Dictionary>>atAll_put";
  246.     Frame f0 = new Frame(exitID);
  247.     indices.$do(Closure.with(f2 -> {
  248.       KeyType key = f2.getValue(0).value();
  249.       return this.at_put(key, element);
  250.     }, "key"));
  251.     return (ElementType)element;
  252.   }

  253.   /**
  254.    * @return
  255.    */
  256.   public   ElementType atAllPut(final ElementType element)
  257.   {
  258.     java.lang.String exitID = "Dictionary>>atAllPut";
  259.     Frame f0 = new Frame(exitID);
  260.     return (ElementType)this.atAll_put(this.keys(), element);
  261.   }

  262.   /**
  263.    * @return
  264.    */
  265.   public   OrderedCollection<ElementType> values()
  266.   {
  267.     java.lang.String exitID = "Dictionary>>values";
  268.     Frame f0 = new Frame(exitID);
  269.     OrderedCollection<ElementType> results = OrderedCollection.type().$new(this.size());
  270.     this.keysAndValuesDo(Closure.with(f2 -> {
  271.       KeyType key = f2.getValue(0).value();
  272.       ElementType element = f2.getValue(1).value();
  273.       return results.add(element);
  274.     }, "key", "element"));
  275.     return (OrderedCollection<ElementType>)results;
  276.   }

  277.   /**
  278.    * @return
  279.    */
  280.   public   ElementType add(final ElementType element)
  281.   {
  282.     java.lang.String exitID = "Dictionary>>add";
  283.     Frame f0 = new Frame(exitID);
  284.     return (ElementType)element;
  285.   }

  286.   /**
  287.    * @return
  288.    */
  289.   public   Collected<ElementType> addAll(final Collected<ElementType> elements)
  290.   {
  291.     java.lang.String exitID = "Dictionary>>addAll";
  292.     Frame f0 = new Frame(exitID);
  293.     return (Collected<ElementType>)elements;
  294.   }

  295.   /**
  296.    * @return
  297.    */
  298.   public   Association add(final Associated pairedElement)
  299.   {
  300.     java.lang.String exitID = "Dictionary>>add";
  301.     Frame f0 = new Frame(exitID);
  302.     this.at_put(pairedElement.key(), ((ElementType)pairedElement.value()));
  303.     return (Association)((Association)pairedElement);
  304.   }

  305.   /**
  306.    * @return
  307.    */
  308.   public   CollectedDictionary addAll(final CollectedDictionary<KeyType, ElementType> pairedElements)
  309.   {
  310.     java.lang.String exitID = "Dictionary>>addAll";
  311.     Frame f0 = new Frame(exitID);
  312.     pairedElements.keysAndValuesDo(Closure.with(f2 -> {
  313.       KeyType key = f2.getValue(0).value();
  314.       ElementType element = f2.getValue(1).value();
  315.       return this.at_put(key, element);
  316.     }, "key", "element"));
  317.     return (CollectedDictionary)pairedElements;
  318.   }

  319.   /**
  320.    * @return
  321.    */
  322.   public   Boolean equals(final Dictionary aCollection)
  323.   {
  324.     java.lang.String exitID = "Dictionary>>equals";
  325.     Frame f0 = new Frame(exitID);
  326.     return (Boolean)Boolean.from(contents.equals(aCollection.primitiveContents()));
  327.   }

  328.   /**
  329.    * @return
  330.    */
  331.   @Override public   Boolean equals(final Collected aCollection)
  332.   {
  333.     java.lang.String exitID = "Dictionary>>equals";
  334.     Frame f0 = new Frame(exitID);
  335.     return (Boolean)Dictionary.type().accepts(aCollection).and(Predicate.with(f2 -> {
  336.       return (this.equals(((Dictionary)aCollection)));
  337.     }, ""));
  338.   }

  339.   /**
  340.    * @return
  341.    */
  342.   @Override public   int hashCode()
  343.   {
  344.     java.lang.String exitID = "Dictionary>>hashCode";
  345.     Frame f0 = new Frame(exitID);
  346.     return (int)contents.hashCode();
  347.   }

  348.   /**
  349.    * @return
  350.    */
  351.   public   Dictionary associationsDo(final MonadicValuable aBlock)
  352.   {
  353.     java.lang.String exitID = "Dictionary>>associationsDo";
  354.     Frame f0 = new Frame(exitID);
  355.     this.keysAndValuesDo(Closure.with(f2 -> {
  356.       KeyType key = f2.getValue(0).value();
  357.       ElementType element = f2.getValue(1).value();
  358.       return aBlock.value(Association.withKey_withValue(key, element));
  359.     }, "key", "element"));
  360.     return (Dictionary)this;
  361.   }

  362.   /**
  363.    * @return
  364.    */
  365.   @Override public   Dictionary collect(final MonadicValuable aBlock)
  366.   {
  367.     java.lang.String exitID = "Dictionary>>collect";
  368.     Frame f0 = new Frame(exitID);
  369.     Dictionary results = Dictionary.type().$new(this.size());
  370.     this.keysAndValuesDo(Closure.with(f2 -> {
  371.       KeyType key = f2.getValue(0).value();
  372.       ElementType element = f2.getValue(1).value();
  373.       return results.at_put(key, aBlock.value(element));
  374.     }, "key", "element"));
  375.     return (Dictionary)results;
  376.   }

  377.   /**
  378.    * @return
  379.    */
  380.   @Override public   Dictionary $do(final MonadicValuable aBlock)
  381.   {
  382.     java.lang.String exitID = "Dictionary>>$do";
  383.     Frame f0 = new Frame(exitID);
  384.     this.keysAndValuesDo(Closure.with(f2 -> {
  385.       KeyType key = f2.getValue(0).value();
  386.       ElementType element = f2.getValue(1).value();
  387.       return aBlock.value(element);
  388.     }, "key", "element"));
  389.     return (Dictionary)this;
  390.   }

  391.   /**
  392.    * @return
  393.    */
  394.   public   Dictionary keysAndValuesDo(final DyadicValuable aBlock)
  395.   {
  396.     java.lang.String exitID = "Dictionary>>keysAndValuesDo";
  397.     Frame f0 = new Frame(exitID);
  398.     this.keys().$do(Closure.with(f2 -> {
  399.       Scalar key = f2.getValue(0).value();
  400.       return aBlock.value_value(key, contents.get(key));
  401.     }, "key"));
  402.     return (Dictionary)this;
  403.   }

  404.   /**
  405.    * @return
  406.    */
  407.   public   Dictionary sortedKeysAndValuesDo(final DyadicValuable aBlock)
  408.   {
  409.     java.lang.String exitID = "Dictionary>>sortedKeysAndValuesDo";
  410.     Frame f0 = new Frame(exitID);
  411.     this.keys().sorted().$do(Closure.with(f2 -> {
  412.       Scalar key = f2.getValue(0).value();
  413.       return aBlock.value_value(key, contents.get(key));
  414.     }, "key"));
  415.     return (Dictionary)this;
  416.   }

  417.   /**
  418.    * @return
  419.    */
  420.   public   Dictionary keysDo(final MonadicValuable aBlock)
  421.   {
  422.     java.lang.String exitID = "Dictionary>>keysDo";
  423.     Frame f0 = new Frame(exitID);
  424.     this.keysAndValuesDo(Closure.with(f2 -> {
  425.       KeyType key = f2.getValue(0).value();
  426.       ElementType element = f2.getValue(1).value();
  427.       return aBlock.value(key);
  428.     }, "key", "element"));
  429.     return (Dictionary)this;
  430.   }

  431.   /**
  432.    * @return
  433.    */
  434.   public   Dictionary valuesDo(final MonadicValuable aBlock)
  435.   {
  436.     java.lang.String exitID = "Dictionary>>valuesDo";
  437.     Frame f0 = new Frame(exitID);
  438.     this.keysAndValuesDo(Closure.with(f2 -> {
  439.       KeyType key = f2.getValue(0).value();
  440.       ElementType element = f2.getValue(1).value();
  441.       return aBlock.value(element);
  442.     }, "key", "element"));
  443.     return (Dictionary)this;
  444.   }

  445.   /**
  446.    * @return
  447.    */
  448.   @Override public   Dictionary reject(final MonadicPredicate aBlock)
  449.   {
  450.     java.lang.String exitID = "Dictionary>>reject";
  451.     Frame f0 = new Frame(exitID);
  452.     Dictionary results = Dictionary.type().$new(this.size());
  453.     this.keysAndValuesDo(Closure.with(f2 -> {
  454.       KeyType key = f2.getValue(0).value();
  455.       ElementType element = f2.getValue(1).value();
  456.       return aBlock.value(element).ifFalse(Closure.with(f3 -> {
  457.       return results.at_put(key, element);
  458.     }, ""));
  459.     }, "key", "element"));
  460.     return (Dictionary)results;
  461.   }

  462.   /**
  463.    * @return
  464.    */
  465.   @Override public   Dictionary select(final MonadicPredicate aBlock)
  466.   {
  467.     java.lang.String exitID = "Dictionary>>select";
  468.     Frame f0 = new Frame(exitID);
  469.     Dictionary results = Dictionary.type().$new(this.size());
  470.     this.keysAndValuesDo(Closure.with(f2 -> {
  471.       KeyType key = f2.getValue(0).value();
  472.       ElementType element = f2.getValue(1).value();
  473.       return aBlock.value(element).ifTrue(Closure.with(f3 -> {
  474.       return results.at_put(key, element);
  475.     }, ""));
  476.     }, "key", "element"));
  477.     return (Dictionary)results;
  478.   }

  479.   /**
  480.    * @return
  481.    */
  482.   public   Dictionary removeAll()
  483.   {
  484.     java.lang.String exitID = "Dictionary>>removeAll";
  485.     Frame f0 = new Frame(exitID);
  486.     contents.clear();
  487.     return (Dictionary)this;
  488.   }

  489.   /**
  490.    * @return
  491.    */
  492.   public   ElementType removeKey(final KeyType key)
  493.   {
  494.     java.lang.String exitID = "Dictionary>>removeKey";
  495.     Frame f0 = new Frame(exitID);
  496.     return (ElementType)this.removeKey_ifAbsent(key, Closure.with(f2 -> {
  497.       this.elementNotFound();
  498.     return Nil.literal();
  499.     }, ""));
  500.   }

  501.   /**
  502.    * @return
  503.    */
  504.   public   ElementType removeKey_ifAbsent(final KeyType key, final NiladicValuable aBlock)
  505.   {
  506.     java.lang.String exitID = "Dictionary>>removeKey_ifAbsent";
  507.     Frame f0 = new Frame(exitID);
  508.     ElementType result = this.at_ifAbsent(key, aBlock);
  509.     contents.remove(key);
  510.     return (ElementType)result;
  511.   }

  512.   /**
  513.    * @return
  514.    */
  515.   public   Dictionary removeAllKeys(final CollectedDistinctly<KeyType> keys)
  516.   {
  517.     java.lang.String exitID = "Dictionary>>removeAllKeys";
  518.     Frame f0 = new Frame(exitID);
  519.     return f0.evaluate(() -> {
  520.     this.removeAllKeys_ifAbsent(keys, Closure.with(f2 -> {
  521.       this.elementNotFound();
  522.     return (Dictionary)f0.exit(exitID, Nil.literal().asPrimitive());
  523.     }, ""));
  524.     return (Dictionary)this;
  525.     });
  526.   }

  527.   /**
  528.    * @return
  529.    */
  530.   public   Dictionary removeAllKeys_ifAbsent(final CollectedDistinctly<KeyType> keys, final MonadicValuable aBlock)
  531.   {
  532.     java.lang.String exitID = "Dictionary>>removeAllKeys_ifAbsent";
  533.     Frame f0 = new Frame(exitID);
  534.     Dictionary results = Dictionary.type().$new(this.size());
  535.     keys.$do(Closure.with(f2 -> {
  536.       KeyType key = f2.getValue(0).value();
  537.       results.at_put(key, this.removeKey_ifAbsent(key, Closure.with(f3 -> {
  538.       return aBlock.value(key);
  539.     }, "")));
  540.     }, "key"));
  541.     return (Dictionary)results;
  542.   }

  543.   /**
  544.    * @return
  545.    */
  546.   public   ElementType remove(final ElementType element)
  547.   {
  548.     java.lang.String exitID = "Dictionary>>remove";
  549.     Frame f0 = new Frame(exitID);
  550.     return (ElementType)this.remove_ifAbsent(element, Closure.with(f2 -> {
  551.       this.elementNotFound();
  552.     return Nil.literal();
  553.     }, ""));
  554.   }

  555.   /**
  556.    * @return
  557.    */
  558.   public   ElementType remove_ifAbsent(final ElementType element, final NiladicValuable aBlock)
  559.   {
  560.     java.lang.String exitID = "Dictionary>>remove_ifAbsent";
  561.     Frame f0 = new Frame(exitID);
  562.     return (ElementType)this.removeKey(this.keyAtValue_ifAbsent(element, aBlock));
  563.   }

  564.   /**
  565.    * @return
  566.    */
  567.   public   Collected<ElementType> removeAll(final Collected<ElementType> elements)
  568.   {
  569.     java.lang.String exitID = "Dictionary>>removeAll";
  570.     Frame f0 = new Frame(exitID);
  571.     elements.$do(Closure.with(f2 -> {
  572.       ElementType element = f2.getValue(0).value();
  573.      
  574.     KeyType key = this.keyAtValue(element);
  575.     return key.notNil().ifTrue(Closure.with(f3 -> {
  576.       return this.removeKey(key);
  577.     }, ""));
  578.     }, "element"));
  579.     return (Collected<ElementType>)elements;
  580.   }

  581.   /**
  582.    * @return
  583.    */
  584.   public   OrderedCollection<ElementType> removeAllSuchThat(final MonadicPredicate criteria)
  585.   {
  586.     java.lang.String exitID = "Dictionary>>removeAllSuchThat";
  587.     Frame f0 = new Frame(exitID);
  588.     OrderedCollection<ElementType> results = OrderedCollection.type().$new();
  589.     this.valuesDo(Closure.with(f2 -> {
  590.       ElementType element = f2.getValue(0).value();
  591.       return criteria.value(element).ifTrue(Closure.with(f3 -> {
  592.       results.add(element);
  593.     this.removeKey(this.keyAtValue(element));
  594.     }, ""));
  595.     }, "element"));
  596.     return (OrderedCollection<ElementType>)results;
  597.   }

  598.   /**
  599.    * @return
  600.    */
  601.   @Override public   Boolean includes(final Subject element)
  602.   {
  603.     java.lang.String exitID = "Dictionary>>includes";
  604.     Frame f0 = new Frame(exitID);
  605.     return (Boolean)Boolean.from(contents.containsValue(((ElementType)element)));
  606.   }

  607.   /**
  608.    * @return
  609.    */
  610.   public   Boolean includesIndex(final KeyType index)
  611.   {
  612.     java.lang.String exitID = "Dictionary>>includesIndex";
  613.     Frame f0 = new Frame(exitID);
  614.     return (Boolean)Boolean.from(contents.containsKey(index));
  615.   }

  616.   /**
  617.    * @return
  618.    */
  619.   public   Posit includesKey(final KeyType key)
  620.   {
  621.     java.lang.String exitID = "Dictionary>>includesKey";
  622.     Frame f0 = new Frame(exitID);
  623.     return (Posit)this.includesIndex(key);
  624.   }
  625. }