Code example for Queue

Methods: add, isEmpty, poll

0
	Animation currentSAnime = null;
 
	List<Animation> parallelAnimes = new LinkedList<Animation>();
 
	public void startSerialAnimation(Animation anime) {
		serialAnimes.add(anime);
		nextSerialAnimation(); 
	} 
 
	public void startParallelAnimation(Animation anime) {
		parallelAnimes.add(anime);
		anime.start();
	} 
 
	public boolean allSerialAnimationFinished() { 
		return currentSAnime == null && serialAnimes.isEmpty();
	} 
 
	private void nextSerialAnimation() { 
		if(!serialAnimes.isEmpty() && currentSAnime == null) {
			currentSAnime = serialAnimes.poll();
			currentSAnime.start();
		} 
	} 
 
	void update() {