Class Index | File Index

## Classes

- _global_
- comb
- comb.array
- comb.characters
- comb.collections
- comb.collections.AnderssonTree
- comb.collections.AVLTree
- comb.collections.BinaryTree
- comb.collections.Collection
- comb.collections.HashTable
- comb.collections.Heap
- comb.collections.Iterable
- comb.collections.MaxHeap
- comb.collections.MinHeap
- comb.collections.Pool
- comb.collections.PriorityQueue
- comb.collections.Queue
- comb.collections.RedBlackTree
- comb.collections.Stack
- comb.collections.Tree
- comb.date
- comb.logging
- comb.logging.appenders
- comb.logging.appenders.Appender
- comb.logging.appenders.ConsoleAppender
- comb.logging.appenders.FileAppender
- comb.logging.appenders.JSONAppender
- comb.logging.appenders.RollingFileAppender
- comb.logging.BasicConfigurator
- comb.logging.Level
- comb.logging.Logger
- comb.logging.PropertyConfigurator
- comb.number
- comb.plugins
- comb.plugins.Broadcaster
- comb.plugins.Middleware
- comb.Promise
- comb.PromiseList
- comb.regexp
- comb.string

# Class comb.collections.Pool

Base class for a pool.
Defined in: Pool.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| comb.collections.Pool()

Field Summary
Field Attributes | Field Name and Description
--- | ---
| count the total number of objects in the pool, including free and in use objects.
| freeCount the number of free objects in this pool.
| inUseCount the number of objects in use in this pool.
| maxObjects the maximum number of objects this pool should contain
| minObjects the minimum number of objects this pool should contain.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| createObject() Creates a new object for this pool.
| getObject() Retrieves an object from this pool.
| removeObject(obj) Removes an object from the pool, this can be overriden to provide any teardown of objects that needs to take place.
| returnObject(obj) Returns an object to this pool.
| validate(obj) Validates an object in this pool.

Class Detail
comb.collections.Pool()
Field Detail
{Number} count
the total number of objects in the pool, including free and in use objects.

{Number} freeCount
the number of free objects in this pool.

{Number} inUseCount
the number of objects in use in this pool.

{Number} maxObjects
the maximum number of objects this pool should contain

Default Value:
  1

{Number} minObjects
the minimum number of objects this pool should contain.

Default Value:
  0

Method Detail
{Object} createObject()
Creates a new object for this pool. * THIS SHOULD BE OVERRIDDEN TO ADD THE CORRECT TYPE OF OBJECT

Returns:
  {Object} be default just creates an object.

{*} getObject()
Retrieves an object from this pool. `

Returns:
  {*} an object to contained in this pool

{*} removeObject(obj)
Removes an object from the pool, this can be overriden to provide any teardown of objects that needs to take place.

Parameters:
{*} obj
  the object that needs to be removed.

Returns:
  {*} the object removed.

returnObject(obj)
Returns an object to this pool. The object is validated before it is returned to the pool, if the validation fails then it is removed from the pool;

Parameters:
{*} obj
  the object to return to the pool

validate(obj)
Validates an object in this pool. THIS SHOULD BE OVERRIDDEN TO VALIDATE

Parameters:
{*} obj
  the object to validate.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 13:20:06 GMT-0500 (CDT)