Constructor
new Pool()
Methods
clearBySign(sign)
Parameters:
Name | Type | Description |
---|---|---|
sign |
String
|
Object type identifier character. |
getItem(sign) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
sign |
String
|
Object type identifier character. |
Returns:
- Type:
-
Object
getItemByClass(sign, cls) → {Object}
Identifies characters based on incoming object types, and gets an object instance of this type identifier in the object pool.
When an object without this type is identified in the object pool, a new object is returned based on the incoming type.
Parameters:
Name | Type | Description |
---|---|---|
sign |
String
|
Object type identifier character. |
cls |
Class
|
The class used to create the type object. |
Returns:
- Type:
-
Object
getItemByCreateFun(sign, createFun) → {Object}
Identifies characters based on incoming object types, and gets an object instance of this type identifier in the object pool.
When an object without this type is identified in the object pool, a new object is returned by using the function of the incoming creation of this type object.
Parameters:
Name | Type | Description |
---|---|---|
sign |
String
|
Object type identifier character. |
createFun |
function
|
Method for creating the type object. |
Returns:
- Type:
-
Object
getPoolBySign(sign) → {Array}
Parameters:
Name | Type | Description |
---|---|---|
sign |
String
|
Object type identifier character. |
Returns:
- Type:
-
Array
recover(sign, item)
Parameters:
Name | Type | Description |
---|---|---|
sign |
String
|
Object type identifier character. |
item |
Object
|
Object. |