Posted By

rvachere on 12/14/09


Tagged

data type interface as3 Queue abstract queueADT adt


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tspitzr


AS3 QueueADT Interface


 / Published in: ActionScript 3
 

  1. package
  2. {
  3.  
  4. /**
  5. * QueueADT interface - Designed to give generic functionality to a queue collection type.
  6. * This collection is to be implemented in a FIFO principles. With adding, removing, searching,
  7. * trace output, and state functions of the collection.
  8. * @author : Richard Vacheresse /|\ http://www.rvacheresse.com /|\
  9. * Licensed for free Commercial and Private use creative commons license agreement.
  10. * The provided code is in an "as-is" state. Richard Vacheresse makes no warranties
  11. * regarding the provided code, and disclaims liability for damages resulting from its use.
  12. * @version 1.0
  13. **/
  14. public interface QueueADT
  15. {
  16. /**
  17. * REMOVE THE FIRST OBJECT FROM THE QUEUE
  18. * @variable - Generic Object
  19. **/
  20. function dequeue():Object;
  21.  
  22. /**
  23. * ADD AN OBJECT TO THE END OF THE QUEUE
  24. * @variable - Generic Object
  25. **/
  26. function enqueue(obj:Object):void;
  27.  
  28. /**
  29. * RETURNS WITHOUT REMOVING THE OBJECT AT THE FRONT OF THE QUEUE
  30. * @return - Boolean Object
  31. **/
  32. function first():Object;
  33.  
  34. /**
  35. * RETURN TRUE IF THE NUMBER VALUE OF THE SIZE OF THE QUEUE
  36. * @return - Number Object
  37. **/
  38. function size():int;
  39.  
  40. /**
  41. * RETURN TRUE IF THE QUEUE OBJECT HAS ZERO OBJECTS
  42. * @return - Boolean Object
  43. **/
  44. function isEmpty():Boolean;
  45.  
  46. /**
  47. * RETURN A STRING REPRESENTATION OF THE CURRENT QUEUE OBJECT
  48. * @return - String Object
  49. **/
  50. function toString():String;
  51.  
  52. }
  53.  
  54. }

Report this snippet  

You need to login to post a comment.