sam.io
Class Tracker

java.lang.Object
  |
  +--sam.io.Tracker
Direct Known Subclasses:
ChecksumTracker

public abstract class Tracker
extends java.lang.Object

This class allows customizable mixing tracking. This is a block-oriented trace that can be used to record checksums or redundancy data.


Field Summary
 java.lang.String description
          A human-readable description of this tracker
 java.lang.String name
          The name of this tracker
 
Constructor Summary
protected Tracker(java.lang.String name, java.lang.String description)
          Builds a new Tracker
 
Method Summary
static sam.io.Tracker get(java.lang.String name)
          Gets the tracker of specified name.
static java.lang.String[] getTrackers()
          Gets the list of all registered trackers.
protected abstract  void load(java.io.DataInputStream input)
          Reloads this tracker state
protected abstract  void save(java.io.DataOutputStream output)
          Saves this tracker state
 void update(byte[] data)
          Updates this tracker state with specified plain data
abstract  void update(byte[] data, int begin, int length)
          Updates this tracker state with specified plain data Warning This method is not supposed to alter the supplied data although for efficiency reason it is still not prevented from doing it.
 void update(int data)
          Updates this tracker state with one byte of plain data
 
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 tracker


description

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

Constructor Detail

Tracker

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

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

get

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

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

getTrackers

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


update

public abstract void update(byte[] data,
                            int begin,
                            int length)
Updates this tracker state with specified plain data Warning This method is not supposed to alter the supplied data although for efficiency reason it is still not prevented from doing it.

Parameters:
data - the plain data to be considered
begin - the beginning of the portion of data considered
length - the length of the portion of data considered

update

public void update(byte[] data)
Updates this tracker state with specified plain data

Parameters:
data - the plain data to be considered

update

public void update(int data)
Updates this tracker state with one byte of plain data

Parameters:
data - the plain data to be considered

save

protected abstract void save(java.io.DataOutputStream output)
                      throws java.io.IOException
Saves this tracker state

java.io.IOException

load

protected abstract void load(java.io.DataInputStream input)
                      throws java.io.IOException
Reloads this tracker state

java.io.IOException