sam.io
Class Packer

java.lang.Object
  |
  +--sam.io.StreamFilter
        |
        +--sam.io.Packer

public abstract class Packer
extends StreamFilter

Generic class for packing and unpacking data.


Field Summary
 java.lang.String description
          A human-readable description of this packer
 java.lang.String name
          The name of this packer
 
Constructor Summary
protected Packer(java.lang.String name, java.lang.String description)
          Builds a new Packer
 
Method Summary
protected abstract  sam.io.Mixer buildMixer()
          Creates a mixer that is well-suited for this Packer Note that this will be called at most once for each Packer instance.
static sam.io.Packer get(java.lang.String name)
          Gets the packer of specified name.
 sam.io.Mixer getMixer()
          Gets the Mixer associated to this Packer Note that the Mixer instance is always the same.
static java.lang.String[] getPackers()
          Gets the list of all registered packers.
 
Methods inherited from class sam.io.StreamFilter
filterInput, filterOutput, finishFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
The name of this packer


description

public final java.lang.String description
A human-readable description of this packer

Constructor Detail

Packer

protected Packer(java.lang.String name,
                 java.lang.String description)
Builds a new Packer

Parameters:
name - the desired packer name
description - a human-readable description
Method Detail

get

public static sam.io.Packer get(java.lang.String name)
Gets the packer of specified name.

Parameters:
name - the name of the desired packer
Returns:
null if no packer has specified name

getPackers

public static java.lang.String[] getPackers()
Gets the list of all registered packers.


buildMixer

protected abstract sam.io.Mixer buildMixer()
Creates a mixer that is well-suited for this Packer Note that this will be called at most once for each Packer instance.


getMixer

public final sam.io.Mixer getMixer()
Gets the Mixer associated to this Packer Note that the Mixer instance is always the same.