infovis.io
Class AbstractReaderFactory

java.lang.Object
  extended by infovis.utils.BasicFactory
      extended by infovis.io.AbstractReaderFactory
Direct Known Subclasses:
GraphReaderFactory, TableReaderFactory, TreeReaderFactory

public abstract class AbstractReaderFactory
extends BasicFactory

Abstract factory of table readers.

Version:
$Revision: 1.18 $
Author:
Jean-Daniel Fekete

Nested Class Summary
static class AbstractReaderFactory.AbstractCreator
           
static interface AbstractReaderFactory.Creator
          Interface for Table Reader creators.
 
Constructor Summary
AbstractReaderFactory(String factoryName)
          Constructor for TableReaderFactory.
 
Method Summary
 void add(AbstractReaderFactory.Creator c)
          Adds a creator of table reader.
 AbstractReader create(InputStream in, String name, Table table)
           
 AbstractReader create(String name, Table table)
          Returns an AbstractReader able to read the specified resource name or null.
 AbstractReaderFactory.Creator getCreatorAt(int index)
          Returns the Creator at a specified index.
 AbstractReaderFactory.Creator getCreatorNamed(String name)
           
 Iterator iterator()
          Returns an iterator over the added creators.
 boolean remove(AbstractReaderFactory.Creator c)
          Removes a creator of table reader.
 boolean tryRead(String name, Table table)
           
 
Methods inherited from class infovis.utils.BasicFactory
loadProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractReaderFactory

public AbstractReaderFactory(String factoryName)
Constructor for TableReaderFactory.

Method Detail

add

public void add(AbstractReaderFactory.Creator c)
Adds a creator of table reader.

Parameters:
c - the Creator.

remove

public boolean remove(AbstractReaderFactory.Creator c)
Removes a creator of table reader.

Parameters:
c - the Creator.
Returns:
true if the Creator was removed.

iterator

public Iterator iterator()
Returns an iterator over the added creators.

Returns:
an iterator over the added creators.

getCreatorAt

public AbstractReaderFactory.Creator getCreatorAt(int index)
Returns the Creator at a specified index.

Parameters:
index - the index.
Returns:
the Creator at a specified index or null.

getCreatorNamed

public AbstractReaderFactory.Creator getCreatorNamed(String name)

create

public AbstractReader create(String name,
                             Table table)
Returns an AbstractReader able to read the specified resource name or null.

Parameters:
name - the resource name.
table - the table.
Returns:
an AbstractReader able to read the specified resource name or null.

create

public AbstractReader create(InputStream in,
                             String name,
                             Table table)

tryRead

public boolean tryRead(String name,
                       Table table)


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.