|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectcomp202.fall2007.a5.filter.NumberMatchType
public abstract class NumberMatchType
A NumberMatchType
object defines a way to determine whether
two integer values match. It is used mostly by SongFilter
s
who define conditions based on numeric attributes of Song
s,
such as the track number or length, to determine whether a Song
matches the conditions they define.
Field Summary | |
---|---|
static NumberMatchType |
AT_LEAST
Implements number matching as a comparison for inequality where the value of the first argument is greater than or equal to the value of the second argument. |
static NumberMatchType |
AT_MOST
Implements number matching as a comparison for inequality where the value of the first argument is less than or equal to the value of the second argument. |
static NumberMatchType |
EQUAL
Implements number matching as a comparison for equality. |
Method Summary | |
---|---|
abstract boolean |
match(int left,
int right)
Determines whether the first specified integer value matches the second specified integer value according to the matching algorithm implemented by this NumberMatchType . |
String |
toString()
Returns a String representation of this
NumberMatchType which describes the type of matching it
represents. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final NumberMatchType AT_LEAST
SongFilter
s to
indicate that this matching type should be used by the new
SongFilter
. In other words, if a SongFilter
that defines a condition based on a numeric attribute of
Song
s uses this NumberMatchType
, it
accepts the Song
if the value of the Song
's
attribute is greater than or equal to the filter value.
public static final NumberMatchType AT_MOST
SongFilter
s to
indicate that this matching type should be used by the new
SongFilter
. In other words, if a SongFilter
that defines a condition based on a numeric attribute of
Song
s uses this NumberMatchType
, it
accepts the Song
if the value of the Song
's
attribute is less than or equal to the filter value.
public static final NumberMatchType EQUAL
SongFilter
s to indicate that this
matching type should be used by the new SongFilter
. In other
words, if a SongFilter
that defines a condition based on a
numeric attribute of Song
s uses this
NumberMatchType
, it accepts the Song
if
the value of the Song
's attribute is equal to the filter
value.
Method Detail |
---|
public String toString()
Returns a String
representation of this
NumberMatchType
which describes the type of matching it
represents.
toString
in class Object
String
representation of this
NumberMatchType
.public abstract boolean match(int left, int right)
Determines whether the first specified integer value matches the second
specified integer value according to the matching algorithm implemented
by this NumberMatchType
.
This method is called internally by methods defined in the
SongFilter
class, and does not need to be called by
classes which use SongFilter
s.
left
- The first integer valueright
- The second integer value
true
if left
matches
right
according to the type of matching algorithm
implemented by this NumberMatchType
,
false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |