Regain 1.7.7-STABLE API

net.sf.regain.crawler.config
Class PreparatorConfig

java.lang.Object
  extended by net.sf.regain.crawler.config.PreparatorConfig

public class PreparatorConfig
extends Object

The configuration of a preparator. Consists of a set of sections which contain a set of key-value-pairs.

Author:
Til Schneider, www.murfman.de

Field Summary
private  ArrayList mSectionList
          The sections of this config.
 
Constructor Summary
PreparatorConfig()
           
 
Method Summary
(package private)  void addSection(String name, Map content)
          Adds a section to the config
 Map getSectionContent(int index)
          Gets the key-value-pairs of a section.
 int getSectionCount()
          Gets the number of sections this config has.
 String getSectionName(int index)
          Gets the name of a section.
 Map[] getSectionsWithName(String name)
          Gets all sections with the given name.
 Map getSectionWithName(String name)
          Gets the first section with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mSectionList

private ArrayList mSectionList
The sections of this config. A section is a Object[] with two elements:
0 (String): The name of the section
1 (Map): The key-value-pairs of the section.

We use no HashMap here, because two sections may have the same name.

Constructor Detail

PreparatorConfig

public PreparatorConfig()
Method Detail

addSection

void addSection(String name,
                Map content)
Adds a section to the config

Parameters:
name - The name of the section to add.
content - The key-value-pairs of the section to add.

getSectionCount

public int getSectionCount()
Gets the number of sections this config has.

Returns:
The number of sections.

getSectionName

public String getSectionName(int index)
Gets the name of a section.

Parameters:
index - The index of the section.
Returns:
The name of the section.

getSectionContent

public Map getSectionContent(int index)
Gets the key-value-pairs of a section.

Parameters:
index - The index of the section.
Returns:
The key-value-pairs of the section.

getSectionWithName

public Map getSectionWithName(String name)
Gets the first section with the given name.

Parameters:
name - The name of the sections
Returns:
The first section with the given name or null if there is no such section.

getSectionsWithName

public Map[] getSectionsWithName(String name)
Gets all sections with the given name.

Parameters:
name - The name of the sections
Returns:
All sections with the given name.

Regain 1.7.7-STABLE API

Regain 1.7.7-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info