Package adams.core
Class StoppableUtils
- java.lang.Object
-
- adams.core.StoppableUtils
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StoppableUtils.StoppableObserver
Observer that records all the objects that implement theStoppable
interface.
-
Constructor Summary
Constructors Constructor Description StoppableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAnyStoppable(Object obj)
Checks whether the object or any of its sub-objects are stoppable.static boolean
isStoppable(Object obj)
Checks whether the object is stoppable.static List<Object>
listStoppable(Object obj)
Determines all the objects that implement theStoppable
interface.static boolean
stopAnyExecution(Object obj)
Stops the execution of the object and its children of they implement theStoppable
interface.static boolean
stopExecution(Object obj)
Stops the execution of the object if itself implements theStoppable
interface.
-
-
-
Field Detail
-
LOGGER
protected static Logger LOGGER
the logger in use.
-
-
Method Detail
-
listStoppable
public static List<Object> listStoppable(Object obj)
Determines all the objects that implement theStoppable
interface.- Parameters:
obj
- the object to inspect, can be null- Returns:
- the list of objects
-
isStoppable
public static boolean isStoppable(Object obj)
Checks whether the object is stoppable.- Parameters:
obj
- the object to check, can be null- Returns:
- true if stoppable
-
isAnyStoppable
public static boolean isAnyStoppable(Object obj)
Checks whether the object or any of its sub-objects are stoppable.- Parameters:
obj
- the object to check, can be null- Returns:
- true if stoppable
-
stopExecution
public static boolean stopExecution(Object obj)
Stops the execution of the object if itself implements theStoppable
interface.- Parameters:
obj
- the object to stop, can be null- Returns:
- true if stopped
-
-