Package adams.core
Class StoppableUtils
- java.lang.Object
-
- adams.core.StoppableUtils
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStoppableUtils.StoppableObserverObserver that records all the objects that implement theStoppableinterface.
-
Constructor Summary
Constructors Constructor Description StoppableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAnyStoppable(Object obj)Checks whether the object or any of its sub-objects are stoppable.static booleanisStoppable(Object obj)Checks whether the object is stoppable.static List<Object>listStoppable(Object obj)Determines all the objects that implement theStoppableinterface.static booleanstopAnyExecution(Object obj)Stops the execution of the object and its children of they implement theStoppableinterface.static booleanstopExecution(Object obj)Stops the execution of the object if itself implements theStoppableinterface.
-
-
-
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 theStoppableinterface.- 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 theStoppableinterface.- Parameters:
obj- the object to stop, can be null- Returns:
- true if stopped
-
-