/** * Registers a Spring to this BaseSpringSystem so it can be iterated if active. * @param spring the Spring to register */ public void registerSpring(Spring spring) { if (spring == null) { throw new IllegalArgumentException("spring is required"); } if (mSpringRegistry.ContainsKey(spring.getId())) { throw new IllegalArgumentException("spring is already registered"); } mSpringRegistry.Add(spring.getId(), spring); }
/** * Deregisters a Spring from this BaseSpringSystem, so it won't be iterated anymore. The Spring should * not be used anymore after doing this. * * @param spring the Spring to deregister */ public void deregisterSpring(Spring spring) { if (spring == null) { throw new IllegalArgumentException("spring is required"); } mActiveSprings.Remove(spring); mSpringRegistry.Remove(spring.getId()); }