opendap.crawler
Class Equivalence

java.lang.Object
  extended by opendap.crawler.Equivalence
All Implemented Interfaces:
java.io.Serializable

public class Equivalence
extends java.lang.Object
implements java.io.Serializable

Store information about a particular 'equivalence class'. Each URLGroup will likely have several of these. Once all the URLs are processed, we will want to look at how individual patterns are distributed to see if the equivalence class should be split or not. The likely criteria for the splitting a class is that all of the instances fall into a very small number of distinct values with zero outliers. At least that's the idea.

Author:
jimg
See Also:
URLProcessedComponents, Serialized Form

Nested Class Summary
 class Equivalence.DateClassifications
           
 class Equivalence.SortedValues
           
 class Equivalence.Values
           
 
Constructor Summary
Equivalence(int n, URLProcessedComponents.Lexeme l)
          Make a new Equivalence.
 
Method Summary
 void add(ParsedURL u)
          Add a new component literal and its source URL to this equivalence class.
 void addDateClassification(DateClassification.DatePart dp)
           
 Equivalence.DateClassifications getDateClassifications()
           
 int getNumberDateClassifications()
           
 int getNumberOfValues()
          How many discreet values exist for this equivalence class?
 int getOccurrences(java.lang.String comp)
          How many times does the value 'comp' show up? For a pattern, this can be any number between 1 and getTotalMembers().
 ParsedURL getParsedURL(java.lang.String comp)
           
 java.lang.String getPattern()
           
 int getPatternPosition()
           
 Equivalence.SortedValues getSortedValues()
           
 int getTotalMembers()
          How many URLs contributed to this class? Should be the same as URLGroup's totalMembers.
 Equivalence.Values getValues()
           
 boolean hasDateClassification(DateClassification.DatePart dp)
           
 boolean isLitteral()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Equivalence

public Equivalence(int n,
                   URLProcessedComponents.Lexeme l)
Make a new Equivalence. This does not add a URL to the Equivalence, it only initializes the 'equivalence class.'

Parameters:
n - Which parsed component of the URL does this Equivalence correspond to
l - What is the component value - and is it a pattern?
Method Detail

add

public void add(ParsedURL u)
Add a new component literal and its source URL to this equivalence class.

Parameters:
u - The Parsed URL

getPatternPosition

public int getPatternPosition()

getPattern

public java.lang.String getPattern()

isLitteral

public boolean isLitteral()

getTotalMembers

public int getTotalMembers()
How many URLs contributed to this class? Should be the same as URLGroup's totalMembers.

Returns:

getOccurrences

public int getOccurrences(java.lang.String comp)
How many times does the value 'comp' show up? For a pattern, this can be any number between 1 and getTotalMembers(). If getIsPattern() is false, this must be equal to getTotalMembers().

Parameters:
comp -
Returns:

getNumberOfValues

public int getNumberOfValues()
How many discreet values exist for this equivalence class?

Returns:

getValues

public Equivalence.Values getValues()

getSortedValues

public Equivalence.SortedValues getSortedValues()

getParsedURL

public ParsedURL getParsedURL(java.lang.String comp)

addDateClassification

public void addDateClassification(DateClassification.DatePart dp)

hasDateClassification

public boolean hasDateClassification(DateClassification.DatePart dp)

getNumberDateClassifications

public int getNumberDateClassifications()

getDateClassifications

public Equivalence.DateClassifications getDateClassifications()