org.jaudiotagger.audio.asf.data
Class MetadataContainerFactory

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.MetadataContainerFactory

public final class MetadataContainerFactory
extends java.lang.Object

A factory for creating appropriate MetadataContainer objects upon specified container types.

Author:
Christian Laireiter

Field Summary
private static MetadataContainerFactory INSTANCE
          Factory instance.
 
Constructor Summary
private MetadataContainerFactory()
          Hidden utility class constructor.
 
Method Summary
 MetadataContainer createContainer(ContainerType type)
          Creates an appropriate container implementation for the given container type.
 MetadataContainer createContainer(ContainerType type, long pos, java.math.BigInteger chunkSize)
          Convenience Method for I/O.
 MetadataContainer[] createContainers(ContainerType[] types)
          Convenience method which calls createContainer(ContainerType) for each given container type.
static MetadataContainerFactory getInstance()
          Returns an instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

private static final MetadataContainerFactory INSTANCE
Factory instance.

Constructor Detail

MetadataContainerFactory

private MetadataContainerFactory()
Hidden utility class constructor.

Method Detail

getInstance

public static MetadataContainerFactory getInstance()
Returns an instance.

Returns:
an instance.

createContainer

public MetadataContainer createContainer(ContainerType type)
Creates an appropriate container implementation for the given container type.

Parameters:
type - the type of container to get a container instance for.
Returns:
appropriate container implementation.

createContainer

public MetadataContainer createContainer(ContainerType type,
                                         long pos,
                                         java.math.BigInteger chunkSize)
Convenience Method for I/O. Same as createContainer(ContainerType), but additionally assigns position and size. (since a MetadataContainer is actually a Chunk).

Parameters:
type - The containers type.
pos - the position within the stream.
chunkSize - the size of the container.
Returns:
an appropriate container implementation with assigned size and position.

createContainers

public MetadataContainer[] createContainers(ContainerType[] types)
Convenience method which calls createContainer(ContainerType) for each given container type.

Parameters:
types - types of the container which are to be created.
Returns:
appropriate container implementations.