org.archive.crawler.settings.refinements
Class TimespanCriteria

java.lang.Object
  extended by org.archive.crawler.settings.refinements.TimespanCriteria
All Implemented Interfaces:
Criteria

public class TimespanCriteria
extends java.lang.Object
implements Criteria

A refinement criteria that checks if a URI is requested within a specific time frame.

The timeframe's resolution is minutes and always operates in 24h GMT. The format is hhmm, exmaples:

1200 for noon GMT
1805 for 5 minutes past six in the afternoon GMT.

Author:
John Erik Halse

Constructor Summary
TimespanCriteria(java.lang.String from, java.lang.String to)
          Create a new instance of TimespanCriteria.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getDescription()
          Returns a description of the Criteria's current settings.
 java.lang.String getFrom()
          Get the beginning of the time frame to check against.
 java.lang.String getName()
          Returns the name of the Criteria type.
 java.lang.String getTo()
          Get the end of the time frame to check against.
 boolean isWithinRefinementBounds(UURI uri)
          Check if a uri is within the bounds of this criteria.
 void setFrom(java.lang.String from)
          Set the beginning of the time frame to check against.
 void setTo(java.lang.String to)
          Set the end of the time frame to check against.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimespanCriteria

public TimespanCriteria(java.lang.String from,
                        java.lang.String to)
                 throws java.text.ParseException
Create a new instance of TimespanCriteria.

Parameters:
from - start of the time frame (inclusive).
to - end of the time frame (inclusive).
Throws:
java.text.ParseException
Method Detail

isWithinRefinementBounds

public boolean isWithinRefinementBounds(UURI uri)
Description copied from interface: Criteria
Check if a uri is within the bounds of this criteria.

Specified by:
isWithinRefinementBounds in interface Criteria
Parameters:
uri - the UURI to check.
Returns:
true if the curi is within the bounds.

getFrom

public java.lang.String getFrom()
Get the beginning of the time frame to check against.

Returns:
Returns the from.

setFrom

public void setFrom(java.lang.String from)
             throws java.text.ParseException
Set the beginning of the time frame to check against.

Parameters:
from - The from to set.
Throws:
java.text.ParseException

getTo

public java.lang.String getTo()
Get the end of the time frame to check against.

Returns:
Returns the to.

setTo

public void setTo(java.lang.String to)
           throws java.text.ParseException
Set the end of the time frame to check against.

Parameters:
to - The to to set.
Throws:
java.text.ParseException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()
Description copied from interface: Criteria
Returns the name of the Criteria type.

Specified by:
getName in interface Criteria
Returns:
the name of the Criteria type

getDescription

public java.lang.String getDescription()
Description copied from interface: Criteria
Returns a description of the Criteria's current settings.

Specified by:
getDescription in interface Criteria
Returns:
a description of the Criteria's current settings.


Copyright © 2003-2011 Internet Archive. All Rights Reserved.