com.lizardtech.djvu
Class IFFEnumeration

java.lang.Object
  extended by com.lizardtech.djvu.DjVuObject
      extended by com.lizardtech.djvu.IFFEnumeration
All Implemented Interfaces:
DjVuInterface, java.util.Enumeration

public class IFFEnumeration
extends DjVuObject
implements java.util.Enumeration

This Enumeration iterates over a CachedInputStream as an ordered list of CachedInputStream's. The chunk id's are stored in the CachedInputStream as the name value. IFF files were originally intended for audio. But is well suited for any streaming data.


Field Summary
protected  CachedInputStream input
          The raw input stream.
protected  CachedInputStream next
          The next CachedInputStream object on the list
 
Fields inherited from class com.lizardtech.djvu.DjVuObject
hasReferences
 
Constructor Summary
IFFEnumeration()
          Creates a new IFFEnumeration object.
 
Method Summary
static boolean check_id(java.lang.String id)
          Check for the specified id
static IFFEnumeration createIFFEnumeration(DjVuInterface ref)
          Creates an instance of IFFEnumeration with the options interherited from the specified reference.
 boolean hasMoreElements()
          Query if there are more CachedInputStream's available.
 IFFEnumeration init(CachedInputStream input)
          Initialize this stream.
 java.lang.Object nextElement()
          Query the next CachedInputStream.
 
Methods inherited from class com.lizardtech.djvu.DjVuObject
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, logError, printStackTrace, setDjVuOptions, verbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected CachedInputStream input
The raw input stream.


next

protected CachedInputStream next
The next CachedInputStream object on the list

Constructor Detail

IFFEnumeration

public IFFEnumeration()
Creates a new IFFEnumeration object.

Method Detail

createIFFEnumeration

public static IFFEnumeration createIFFEnumeration(DjVuInterface ref)
Creates an instance of IFFEnumeration with the options interherited from the specified reference.

Parameters:
ref - Object to interherit DjVuOptions from.
Returns:
a new instance of IFFEnumeration.

init

public IFFEnumeration init(CachedInputStream input)
Initialize this stream.

Parameters:
input - data source
Returns:
the initialized stream

hasMoreElements

public boolean hasMoreElements()
Query if there are more CachedInputStream's available.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
True if there is another CachedInputStream available.

nextElement

public java.lang.Object nextElement()
                             throws java.util.NoSuchElementException
Query the next CachedInputStream.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next CachedInputStream.
Throws:
java.util.NoSuchElementException - if there are no more streams available.

check_id

public static boolean check_id(java.lang.String id)
                        throws java.io.IOException
Check for the specified id

Parameters:
id - id to check for
Returns:
true if the id was found
Throws:
java.io.IOException - if an error occurs