coolcode test

  1. /*
  2. Copyright (c) 2006 - 2008  Eric J. Feminella  <eric@ericfeminella.com>
  3. All rights reserved.
  4.  
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is furnished
  10. to do so, subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in all
  13. copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  20. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  
  22. @internal
  23. */
  24.  
  25. package com.ericfeminella.collections
  26. {
  27.     import flash.utils.Dictionary;
  28.     import mx.collections.IList;
  29.    
  30.     /**
  31.      *
  32.      * Defines the contract for lightweight HashMap implementations
  33.      * which are to expose an API into a managed collection of key
  34.      * value pairs
  35.      *
  36.      */
  37.     public interface IMap
  38.     {
  39.         /**
  40.          *
  41.          * Adds a key / value pair to the current Map
  42.          *
  43.          * @param the key to add to the map
  44.          * @param the value of the specified key
  45.          *
  46.          */
  47.         function put(key:*, value:*) : void;
  48.        
  49.         /**
  50.          *
  51.          * Places all name / value pairs into the current
  52.          * <code>IMap</code> instance.
  53.          * 
  54.          * @param an <code>Object</code> of name / value pairs
  55.          *
  56.          */       
  57.         function putAll(table:Dictionary) : void;
  58.        
  59.         /**
  60.          *
  61.          * <code>putEntry</code> is intended as a pseudo-overloaded
  62.          * <code>put</code> implementation whereby clients may call
  63.          * <code>putEntry</code> to pass an <code>IHashMapEntry</code>
  64.          * implementation.
  65.          * 
  66.          * @param concrete <code>IHashMapEntry</code> implementation
  67.          *
  68.          */       
  69.         function putEntry(entry:IHashMapEntry) : void;
  70.        
  71.         /**
  72.          *
  73.          * Removes a key / value from the HashMap instance
  74.          * 
  75.          * @param  key to remove from the map
  76.          *
  77.          */
  78.         function remove(key:*) : void;
  79.  
  80.         /**
  81.          *
  82.          * Determines if a key exists in the HashMap instance
  83.          *
  84.          * @param  the key in which to determine existance in the map
  85.          * @return true if the key exisits, false if not
  86.          *
  87.          */
  88.         function containsKey(key:*) : Boolean;
  89.  
  90.         /**
  91.          *
  92.          * Determines if a value exists in the HashMap instance
  93.          *
  94.          * @param  the value in which to determine existance in the map
  95.          * @return true if the value exisits, false if not
  96.          *
  97.          */
  98.         function containsValue(value:*) : Boolean;
  99.  
  100.         /**
  101.          *
  102.          * Returns a key value from the HashMap instance
  103.          *
  104.          * @param  the key in which to retrieve the value of
  105.          * @return the value of the specified key
  106.          *
  107.          */
  108.         function getKey(value:*) : *;
  109.  
  110.         /**
  111.          *
  112.          * Returns a key value from the HashMap instance
  113.          *
  114.          * @param  the key in which to retrieve the value of
  115.          * @return the value of the specified key
  116.          *
  117.          */
  118.         function getValue(key:*) : *;
  119.  
  120.         /**
  121.          *
  122.          * Returns each key added to the HashMap instance
  123.          *
  124.          * @return String Array of key identifiers
  125.          *
  126.          */
  127.         function getKeys() : Array;
  128.  
  129.         /**
  130.          *
  131.          * Returns each value assigned to each key in the HashMap instance
  132.          *
  133.          * @return Array of values assigned for all keys in the map
  134.          *
  135.          */
  136.         function getValues() : Array;
  137.        
  138.         /**
  139.          *
  140.          * Retrieves the size of the HashMap instance
  141.          *
  142.          * @return the current size of the map instance
  143.          *
  144.          */
  145.         function size() : int;
  146.  
  147.         /**
  148.          *
  149.          * Determines if the HashMap instance is empty
  150.          *
  151.          * @return true if the current map is empty, false if not
  152.          *
  153.          */
  154.         function isEmpty() : Boolean;
  155.        
  156.         /**
  157.          *
  158.          * Resets all key value assignments in the HashMap instance to null
  159.          *
  160.          */
  161.         function reset() : void;   
  162.        
  163.         /**
  164.          *
  165.          * Resets all key / values defined in the HashMap instance to null
  166.          *
  167.          */
  168.         function resetAllExcept(key:*) : void;   
  169.                
  170.         /**
  171.          *
  172.          * Clears all key / values defined in the HashMap instance
  173.          *
  174.          */
  175.         function clear() : void;
  176.  
  177.         /**
  178.          *
  179.          * Clears all key / values defined in the HashMap instance
  180.          * with the exception of the specified key
  181.          *
  182.          */
  183.         function clearAllExcept(key:*) : void;
  184.        
  185.         /**
  186.          *
  187.          * <code>putEntry</code> is intended as a pseudo-overloaded
  188.          * <code>put</code> implementation whereby clients may call
  189.          * <code>putEntry</code> to pass an <code>IHashMapEntry</code>
  190.          * implementation.
  191.          * 
  192.          * @param concrete <code>IHashMapEntry</code> implementation
  193.          *
  194.          */       
  195.         function getEntries() : IList;
  196.     }
  197. }
Posted in Uncategorized.

One Response to “coolcode test”

  1. admin Says:

    here is a test

Leave a Reply