com.webrenderer
Class HistoryPage

java.lang.Object
  extended bycom.webrenderer.HistoryPage

public class HistoryPage
extends java.lang.Object

Represents a single page in the History list of a web browser.


Constructor Summary
HistoryPage(java.lang.String data)
          Creates a HistoryPage with the URL passed as data.
 
Method Summary
 java.util.Date getDate()
          Gets the date.
 java.lang.String getURL()
          Gets the URL.
 boolean isNewer(HistoryPage p)
          Returns true if the HistoryPage was accessed on a more recent date that the one being compared to, false otherwise.
 boolean isSame(HistoryPage p)
          Compares two HistoryPage objects for equality.
 boolean sameDomain(HistoryPage p)
          Compares two HistoryPage objects for the same domain.
 java.lang.String toString()
          Gets the history in String format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HistoryPage

public HistoryPage(java.lang.String data)
Creates a HistoryPage with the URL passed as data. The time of creation is recorded.

Parameters:
data - A URL.
Method Detail

isNewer

public boolean isNewer(HistoryPage p)
Returns true if the HistoryPage was accessed on a more recent date that the one being compared to, false otherwise.

Parameters:
p - A HistoryPage object to compare to.

isSame

public boolean isSame(HistoryPage p)
Compares two HistoryPage objects for equality.

Parameters:
p - - A HistoryPage object to compare.
Returns:
true if the HistoryPage refers to the same URL as the page passed in, false otherwise.

sameDomain

public boolean sameDomain(HistoryPage p)
Compares two HistoryPage objects for the same domain.

Parameters:
p - - A HistoryPage object to compare.
Returns:
true if the domain sections of the URL stored in this HistoryPage and the passed HistoryPage are the same, false otherwise.

getURL

public java.lang.String getURL()
Gets the URL.

Returns:
the URL portion of this HistoryPage.

getDate

public java.util.Date getDate()
Gets the date.

Returns:
the date portion of this HistoryPage

toString

public java.lang.String toString()
Gets the history in String format.

Returns:
a String representation of the HistoryPage in the form: PageURL\t||\tDateViewed\n