com.xuggle.mediatool
Class AMediaGeneratorMixin

Package class diagram package AMediaGeneratorMixin
java.lang.Object
  extended by com.xuggle.mediatool.AMediaGeneratorMixin
Direct Known Subclasses:
AMediaToolMixin, MediaGeneratorAdapter

public abstract class AMediaGeneratorMixin
extends Object

An abstract implementation of all IMediaGenerator methods, but does not declare IMediaGenerator.

This class manages all attached IMediaListener objects in a thread-safe set. The is fast to iterate over -- at the expense of a copy on addListener(IMediaListener) and removeListener(IMediaListener).

Mixin classes can be extended by anyone, but the extending class gets to decide which, if any, of the interfaces they actually want to support.


Constructor Summary
AMediaGeneratorMixin()
          Create an AMediaGeneratorMixin.
 
Method Summary
 boolean addListener(IMediaListener listener)
          Adds this listener to a thread-safe set.
 Collection<IMediaListener> getListeners()
          Get a read-only collection of added IMediaListener objects.
 boolean removeListener(IMediaListener listener)
          Remove this listener from the thread-safe set of IMediaListener objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMediaGeneratorMixin

public AMediaGeneratorMixin()
Create an AMediaGeneratorMixin.

Method Detail

addListener

public boolean addListener(IMediaListener listener)
Adds this listener to a thread-safe set.

Returns:
true if the set was modified when adding this call.

removeListener

public boolean removeListener(IMediaListener listener)
Remove this listener from the thread-safe set of IMediaListener objects.

Returns:
true if the set was modified by this call.

getListeners

public Collection<IMediaListener> getListeners()
Get a read-only collection of added IMediaListener objects.

Returns:
a read-only collection of IMediaListener objects.


Copyright © 2008, 2010 Xuggle