eTextReader.search
Class SearchEvent

java.lang.Object
  extended by eTextReader.search.SearchEvent

public class SearchEvent
extends java.lang.Object

This class represents events that are passed by the searching components back to the interested parties to let them know when various actions have been performed

Author:
mcfall

Nested Class Summary
static class SearchEvent.EVENT_TYPE
           
 
Field Summary
private  java.lang.Object argument
           
private  java.lang.Object source
           
private  SearchEvent.EVENT_TYPE type
           
 
Constructor Summary
SearchEvent(java.lang.Object source, SearchEvent.EVENT_TYPE type, java.lang.Object arg)
          Constructs a SearchEvent with the specified properties.
 
Method Summary
 java.lang.Object getArgument()
          Retrieves the argument associated with the event.
 SearchEvent.EVENT_TYPE getEventType()
          Retrieves the type of event
 java.lang.Object getSource()
          Retrieves the source of the event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private java.lang.Object source

type

private SearchEvent.EVENT_TYPE type

argument

private java.lang.Object argument
Constructor Detail

SearchEvent

public SearchEvent(java.lang.Object source,
                   SearchEvent.EVENT_TYPE type,
                   java.lang.Object arg)
Constructs a SearchEvent with the specified properties.

Parameters:
source - the object that caused this event to be fired
type - the kind of event this event represents
arg - an arbitrary object associated with the event
Method Detail

getEventType

public SearchEvent.EVENT_TYPE getEventType()
Retrieves the type of event

Returns:
an EVENT_TYPE object representing the type of event

getArgument

public java.lang.Object getArgument()
Retrieves the argument associated with the event.

Returns:
an object associated with the event, dependent on the type of event, according to the following table:
  • RESULTS_AVAILABLE: a List of WebPageRelevance items describing the pages that matched the search terms
  • FIND_NEXT: the search term(s) that were used
  • SEARCH_TYPE_CHANGED: a SEARCH_TYPE enum
  • FIND_CANCELLED: null

getSource

public java.lang.Object getSource()
Retrieves the source of the event

Returns:
an object that caused the event to be fired