public class SwimmingPool extends java.lang.Object
Constructor and Description |
---|
SwimmingPool() |
Modifier and Type | Method and Description |
---|---|
void |
add(SwimmingObject object) |
void |
addListener(SwimmingPoolListener listener) |
int |
getCount(java.lang.Class<?> objectType)
Return the number of object with the specified class type contained in the swimming pool.
|
int |
getCount(java.lang.String name,
boolean startWith)
Return the number of object with the specified name (or name starting with specified name)
contained in the swimming pool.
|
java.util.ArrayList<SwimmingObject> |
getObjects()
Return all objects of the swimming pool
|
java.util.ArrayList<SwimmingObject> |
getObjects(java.lang.Class<?> objectType)
Return objects of specified class type
|
java.util.ArrayList<SwimmingObject> |
getObjects(java.lang.String name,
boolean startWith)
Return objects with specified name (or name starting with specified name).
|
boolean |
hasObjects(java.lang.Class<?> objectType)
Return true if the swimming pool contains at least one object with the specified class type.
|
boolean |
hasObjects(java.lang.String name,
boolean startWith)
Return true if the swimming pool contains at least one object with the specified name (or
name starting with specified name).
|
java.util.ArrayList<SwimmingObject> |
popObjects(java.lang.Class<?> objectType)
Return and remove objects of specified class type
|
java.util.ArrayList<SwimmingObject> |
popObjects(java.lang.String name,
boolean startWith)
Return and remove objects with specified name (or name starting with specified name).
|
void |
remove(SwimmingObject object) |
void |
removeAll() |
void |
removeAll(java.lang.Class<?> objectType)
Remove all object of specified class type
|
void |
removeAll(java.util.Collection<SwimmingObject> sos)
Remove all objects contained in the collection from the swimming pool.
|
void |
removeAll(java.lang.String name,
boolean startWith)
Remove all object with specified name (or name starting with specified name).
|
void |
removeListener(SwimmingPoolListener listener) |
public SwimmingPool()
public void add(SwimmingObject object)
public void remove(SwimmingObject object)
public void removeAll()
public void removeAll(java.util.Collection<SwimmingObject> sos)
public void removeAll(java.lang.String name, boolean startWith)
public void removeAll(java.lang.Class<?> objectType)
public java.util.ArrayList<SwimmingObject> getObjects()
public java.util.ArrayList<SwimmingObject> getObjects(java.lang.String name, boolean startWith)
public java.util.ArrayList<SwimmingObject> getObjects(java.lang.Class<?> objectType)
public java.util.ArrayList<SwimmingObject> popObjects(java.lang.String name, boolean startWith)
public java.util.ArrayList<SwimmingObject> popObjects(java.lang.Class<?> objectType)
public boolean hasObjects(java.lang.String name, boolean startWith)
public boolean hasObjects(java.lang.Class<?> objectType)
public int getCount(java.lang.String name, boolean startWith)
public int getCount(java.lang.Class<?> objectType)
public void addListener(SwimmingPoolListener listener)
public void removeListener(SwimmingPoolListener listener)