xsmeral.semnet.crawler.model
Class EntityDescriptor

java.lang.Object
  extended by xsmeral.semnet.crawler.model.EntityDescriptor

@XStreamConverter(value=EntityDescConverter.class)
public class EntityDescriptor
extends Object

Part of the configuration of HTMLCrawler, describes one entity type of a host.
Contains:

In runtime, the reference to parent HostDescriptor is kept. The hashCode is pre-computed for fast map lookup.


Constructor Summary
EntityDescriptor(Pattern urlPattern, int updateFreq, Collection<Configuration> scrapers, int weight)
          Initializes all fields
 
Method Summary
 boolean equals(Object obj)
           
 HostDescriptor getHostDesc()
          Returns the owning HostDescriptor.
 Collection<Configuration> getScrapers()
          Returns the scraper classes that processes this entity type.
 int getUpdateFreq()
          Returns the update frequency for this entity type, in seconds.
 Pattern getUrlPattern()
          Returns the URL pattern that identifies this entity type.
 int getWeight()
          Returns the "weight" of this entity, a measue of preference.
 int hashCode()
          Returns (pre-computed) hash code.
 void setHostDesc(HostDescriptor hostDesc)
          Sets the owning HostDescriptor.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityDescriptor

public EntityDescriptor(Pattern urlPattern,
                        int updateFreq,
                        Collection<Configuration> scrapers,
                        int weight)
Initializes all fields

Method Detail

getScrapers

public Collection<Configuration> getScrapers()
Returns the scraper classes that processes this entity type.


getUrlPattern

public Pattern getUrlPattern()
Returns the URL pattern that identifies this entity type.


getUpdateFreq

public int getUpdateFreq()
Returns the update frequency for this entity type, in seconds.


getHostDesc

public HostDescriptor getHostDesc()
Returns the owning HostDescriptor.


setHostDesc

public void setHostDesc(HostDescriptor hostDesc)
Sets the owning HostDescriptor.


getWeight

public int getWeight()
Returns the "weight" of this entity, a measue of preference.


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Returns (pre-computed) hash code.

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object