Koowa_Object
[ class tree: Koowa_Object ] [ index: Koowa_Object ] [ all elements ]

Class: KObjectQueue

Source Location: /libraries/koowa/object/queue.php

Class Overview

KObject
   |
   --KObjectQueue

Object Queue Class


Author(s):

Implements interfaces:

  • Iterator (internal interface)
  • Countable (internal interface)

Variables

Methods


Child classes:

KCommandChain
Command Chain

Inherited Variables

Inherited Methods

Class: KObject

KObject::__construct()
Constructor
KObject::get()
Get the object properties
KObject::getHandle()
Get a handle for this object
KObject::getIdentifier()
Gets the service identifier.
KObject::getMethods()
Get a list of all the available methods
KObject::getService()
Get an instance of a class based on a class identifier only creating it if it does not exist yet.
KObject::inherits()
Checks if the object or one of it's mixin's inherits from a class.
KObject::mixin()
Mixin an object
KObject::set()
Set the object properties
KObject::_initialize()
Initializes the options for the object
KObject::__call()
Search the mixin method map and call the method or trigger an error
KObject::__clone()
Preform a deep clone of the object.

Class Details

[line 22]
Object Queue Class

KObjectQueue is a type of container adaptor implemented as a double linked list and specifically designed such that its first element is always the greatest of the elements it contains based on the priority of the element.




Tags:



[ Top ]


Class Variables

$_object_list =  null

[line 29]

Object list



Tags:

access:  protected

Type:   array


[ Top ]

$_priority_list =  null

[line 36]

Priority list



Tags:

access:  protected

Type:   array


[ Top ]



Class Methods


constructor __construct [line 44]

\KObjectQueue __construct( [ $config = null])

Constructor



Tags:

access:  public


Overridden in child classes as:

KCommandChain::__construct()
Constructor

Overrides KObject::__construct() (Constructor)

Parameters:

KConfig|null   $config   An optional KConfig object with configuration options

[ Top ]

method contains [line 167]

bool contains( KObjectHandlable $object)

Check if the queue does contain a given object



Tags:

throws:  InvalidArgumentException if the object doesn't implement KObjectHandlable
access:  public


Overridden in child classes as:

KCommandChain::contains()
Check if the queue does contain a given object

Parameters:

KObjectHandlable   $object  

[ Top ]

method count [line 185]

int count( )

Returns the number of elements in the queue

Required by the Countable interface




Tags:

access:  public



Implementation of:
Countable::count
[ Top ]

method current [line 236]

mixed current( )

Return current object pointed by the iterator

Required by the Iterator interface




Tags:

access:  public



Implementation of:
Iterator::current
[ Top ]

method dequeue [line 88]

boolean dequeue( KObjectHandlable $object)

Removes an object from the queue



Tags:

return:  TRUE on success FALSE on failure
throws:  InvalidArgumentException if the object implement KObjectHandlable
access:  public


Overridden in child classes as:

KCommandChain::dequeue()
Removes a command from the queue

Parameters:

KObjectHandlable   $object  

[ Top ]

method enqueue [line 64]

boolean enqueue( KObjectHandlable $object, integer $priority)

Inserts an object to the queue.



Tags:

return:  TRUE on success FALSE on failure
throws:  InvalidArgumentException if the object doesn't implement KObjectHandlable
access:  public


Overridden in child classes as:

KCommandChain::enqueue()
Attach a command to the chain

Parameters:

KObjectHandlable   $object  
integer   $priority  

[ Top ]

method getPriority [line 134]

integer|false getPriority( KObjectHandlable $object)

Get the priority of an object in the queue



Tags:

return:  The command priority or FALSE if the commnand isn't enqueued
throws:  InvalidArgumentException if the object doesn't implement KObjectHandlable
access:  public


Overridden in child classes as:

KCommandChain::getPriority()
Get the priority of a command

Parameters:

KObjectHandlable   $object  

[ Top ]

method hasPriority [line 154]

boolean hasPriority( integer $priority)

Check if the queue has an item with the given priority



Tags:

access:  public


Parameters:

integer   $priority   The priority to search for

[ Top ]

method isEmpty [line 275]

boolean isEmpty( )

Checks whether the queue is empty



Tags:

access:  public


[ Top ]

method key [line 224]

mixed key( )

Return current object index

Required by the Iterator interface




Tags:

access:  public



Implementation of:
Iterator::key
[ Top ]

method next [line 248]

void next( )

Move to the next object

Required by the Iterator interface




Tags:

access:  public



Implementation of:
Iterator::next
[ Top ]

method rewind [line 197]

object KObjectQueue rewind( )

Rewind the Iterator to the top

Required by the Iterator interface




Tags:

access:  public



Implementation of:
Iterator::rewind
[ Top ]

method setPriority [line 114]

KCommandChain setPriority( KObjectHandlable $object, integer $priority)

Set the priority of an object in the queue



Tags:

throws:  InvalidArgumentException if the object doesn't implement KObjectHandlable
access:  public


Overridden in child classes as:

KCommandChain::setPriority()
Set the priority of a command

Parameters:

KObjectHandlable   $object  
integer   $priority  

[ Top ]

method top [line 258]

KObject top( )

Return the object from the top of the queue



Tags:

return:  or NULL is queue is empty
access:  public


[ Top ]

method valid [line 212]

boolean valid( )

Check whether the queue contains more object

Required by the Iterator interface




Tags:

access:  public



Implementation of:
Iterator::valid
[ Top ]

method __clone [line 285]

void __clone( )

Preform a deep clone of the object



Tags:

access:  public


Overrides KObject::__clone() (Preform a deep clone of the object.)

[ Top ]


Documentation generated on Sun, 19 May 2013 03:05:14 +0200 by phpDocumentor 1.4.3