BaseSpringSystem class

BaseSpringSystem maintains the set of springs within an Application context. It is responsible for Running the spring integration loop and maintains a registry of all the Springs it solves for. In addition to listening to physics events on the individual Springs in the system, listeners can be added to the BaseSpringSystem itself to provide pre and post integration setup.

Implementers

Constructors

BaseSpringSystem(SpringLooper springLooper)
create a new BaseSpringSystem @param springLooper parameterized springLooper to allow testability of the physics loop

Properties

hashCode int
The hash code for this object.
no setterinherited
mSpringLooper SpringLooper
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

activateSpring(String springId) → void
This is used internally by the {@link Spring}s created by this {@link BaseSpringSystem} to notify it has reached a state where it needs to be iterated. This will add the spring to the list of active springs on this system and start the iteration if the system was idle before this call. @param springId the id of the Spring to be activated
addListener(SpringSystemListener newListener) → void
Add new listener object. @param newListener listener
advance(double deltaTime) → void
update the springs in the system @param deltaTime delta since last update in millis
createSpring() Spring
create a spring with a random uuid for its name. @return the spring
deregisterSpring(Spring spring) → void
Deregisters a Spring from this BaseSpringSystem, so it won't be iterated anymore. The Spring should not be used anymore after doing this.
getAllSprings() List<Spring>
return all the springs in the simulator @return all the springs
getIsIdle() bool
check if the system is idle @return is the system idle
getSpringById(String id) Spring?
get a spring by name @param id id of the spring to retrieve @return Spring with the specified key
loop(double elapsedMillis) → void
loop the system until idle @param elapsedMillis elapsed milliseconds
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerSpring(Spring spring) → void
Registers a Spring to this BaseSpringSystem so it can be iterated if active. @param spring the Spring to register
removeAllListeners() → void
Remove all listeners.
removeListener(SpringSystemListener listenerToRemove) → void
Remove listener object. @param listenerToRemove listener
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited