com.xuggle.mediatool
Class MediaGeneratorAdapter

Package class diagram package MediaGeneratorAdapter
java.lang.Object
  extended by com.xuggle.mediatool.AMediaGeneratorMixin
      extended by com.xuggle.mediatool.MediaGeneratorAdapter
All Implemented Interfaces:
IMediaGenerator

public class MediaGeneratorAdapter
extends AMediaGeneratorMixin
implements IMediaGenerator

An implementation of 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).

This can be useful if you want to implement your own version of IMediaGenerator, but want someone to declare support for it, and implement the interface.


Constructor Summary
MediaGeneratorAdapter()
          Create a MediaGeneratorAdapter.
 
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

MediaGeneratorAdapter

public MediaGeneratorAdapter()
Create a MediaGeneratorAdapter.

Method Detail

addListener

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

Specified by:
addListener in interface IMediaGenerator
Overrides:
addListener in class AMediaGeneratorMixin
Parameters:
listener - the listener to add
Returns:
true if the set was modified when adding this call.

getListeners

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

Specified by:
getListeners in interface IMediaGenerator
Overrides:
getListeners in class AMediaGeneratorMixin
Returns:
a read-only collection of IMediaListener objects.

removeListener

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

Specified by:
removeListener in interface IMediaGenerator
Overrides:
removeListener in class AMediaGeneratorMixin
Parameters:
listener - the listener to remove
Returns:
true if the set was modified by this call.


Copyright © 2008, 2010 Xuggle