comp202.fall2007.a5.filter
Class SongFilter

Object
  extended by comp202.fall2007.a5.filter.SongFilter

public abstract class SongFilter
extends Object

A SongFilter defines a condition that Songs can satisfy, and provides a method to verify whether or not a Song satisfies this condition.


Constructor Summary
SongFilter()
          Creates a new SongFilter.
 
Method Summary
abstract  boolean accept(Song song)
           Determines whether the Song satisfies or passes the condition defines by this SongFilter.
abstract  String toString()
           Returns a String representation of this SongFilter in the form of a boolean expression which determines the Songs it accepts and those it rejects.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SongFilter

public SongFilter()
Creates a new SongFilter.

Method Detail

accept

public abstract boolean accept(Song song)

Determines whether the Song satisfies or passes the condition defines by this SongFilter. Such a Song is said to be accepted by the SongFilter; Songs that do not satisfy the condition defined by this SongFilter are said to be rejected by the latter.

Parameters:
song - The Song to be tried with this filter.
Returns:
true if this SongFilter accepts song, false otherwise.

toString

public abstract String toString()

Returns a String representation of this SongFilter in the form of a boolean expression which determines the Songs it accepts and those it rejects.

Overrides:
toString in class Object
Returns:
A String representation of this SongFilter.