net.sf.mmm.util.io.base
Class AbstractDetectorStream

java.lang.Object
  extended by net.sf.mmm.util.io.base.AbstractDetectorStream
All Implemented Interfaces:
DetectorStream
Direct Known Subclasses:
ProcessableDetectorStream

public abstract class AbstractDetectorStream
extends Object
implements DetectorStream

This is the abstract base implementation of a DetectorStream.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  boolean done
           
private  Map<String,Object> metadata
           
private  Map<String,Object> mutableMetadata
           
 
Constructor Summary
AbstractDetectorStream()
          The constructor.
AbstractDetectorStream(Map<String,Object> mutableMetadata)
          The constructor.
 
Method Summary
 Map<String,Object> getMetadata()
          This method gets the context with the detected metadata.
protected  Map<String,Object> getMutableMetadata()
          This method gets the mutable Metadata.
 boolean isDone()
          This method determines if the detection is done.
protected  void setDone()
          This method sets the done flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mutableMetadata

private final Map<String,Object> mutableMetadata
See Also:
getMetadata()

metadata

private final Map<String,Object> metadata
See Also:
getMetadata()

done

private boolean done
See Also:
isDone()
Constructor Detail

AbstractDetectorStream

public AbstractDetectorStream()
The constructor.


AbstractDetectorStream

public AbstractDetectorStream(Map<String,Object> mutableMetadata)
The constructor.

Parameters:
mutableMetadata - is the initial mutable metadata.
Method Detail

getMetadata

public Map<String,Object> getMetadata()
This method gets the context with the detected metadata. It is immutable and should NOT be modified. This method should NOT be called, before this detector stream is done.
For the keys to use in the metadata Map have a look at net.sf.mmm.util.metakey.api.MetakeyCore.

Specified by:
getMetadata in interface DetectorStream
Returns:
the metadata.

getMutableMetadata

protected Map<String,Object> getMutableMetadata()
This method gets the mutable Metadata.

Returns:
the internal Metadata-Map that is mutable.

setDone

protected void setDone()
This method sets the done flag.


isDone

public boolean isDone()
This method determines if the detection is done. If the stream has been processed to the end this method will always return true. However the detection may be done before the end of the stream was reached (e.g. because all metadata comes from the header of the data).

Specified by:
isDone in interface DetectorStream
Returns:
true if the metadata has been completely been collected, false otherwise.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.