Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.filter
Class LongFilter

java.lang.Object
  extended by com.sciapp.filter.Filter
      extended by com.sciapp.filter.ComparisonFilter
          extended by com.sciapp.filter.NumberFilter
              extended by com.sciapp.filter.LongFilter
All Implemented Interfaces:
Serializable

public class LongFilter
extends NumberFilter

A filter for Long values.

See Also:
Serialized Form

Field Summary
protected  long value
          the long value the supplied objects are matched against.
 
Fields inherited from class com.sciapp.filter.ComparisonFilter
comparison, EQ, GE, GT, LE, LT, NE
 
Fields inherited from class com.sciapp.filter.Filter
acceptNull
 
Constructor Summary
LongFilter()
          Constructs a LongFilter.
LongFilter(long l)
          Constructs a LongFilter.
 
Method Summary
 boolean accept(long i)
          Matches the long value i against the current filter.
 boolean accept(Object value)
          Decides whether to accept the value supplied.
 boolean fromString(String str)
          Parses the supplied string to a Number and returns a boolean indicating if the parsing was successful.
 Number getNumber()
          Returns the Number object which is set as the filter pattern.
 void setLong(long i)
          Sets the long value used to match against Number objects.
 void setNumber(Number n)
          Assigns a new Number object as the filter pattern.
 
Methods inherited from class com.sciapp.filter.NumberFilter
getFilterPattern, setFilterPattern
 
Methods inherited from class com.sciapp.filter.ComparisonFilter
getComparison, setComparison
 
Methods inherited from class com.sciapp.filter.Filter
getAcceptNull, setAcceptNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected long value
the long value the supplied objects are matched against.

Constructor Detail

LongFilter

public LongFilter()
Constructs a LongFilter.


LongFilter

public LongFilter(long l)
Constructs a LongFilter.

Method Detail

accept

public boolean accept(long i)
Matches the long value i against the current filter.

Parameters:
i - the long to match
Returns:
true if the value matched

accept

public boolean accept(Object value)
Decides whether to accept the value supplied.

Specified by:
accept in class Filter
Parameters:
value - the object we want to decide if it will be filtered or not.
Returns:
true if the object matched and should not be filtered out, false otherwise.

fromString

public boolean fromString(String str)
Parses the supplied string to a Number and returns a boolean indicating if the parsing was successful.

Specified by:
fromString in class NumberFilter
Parameters:
str - the string to parse to a Number
Returns:
true if the supplied string was successfully parsed, false otherwise.

getNumber

public Number getNumber()
Returns the Number object which is set as the filter pattern.

Specified by:
getNumber in class NumberFilter
Returns:
the filter pattern as a Number

setLong

public void setLong(long i)
Sets the long value used to match against Number objects.

Parameters:
i - the long value filter.

setNumber

public void setNumber(Number n)
Assigns a new Number object as the filter pattern.

Specified by:
setNumber in class NumberFilter
Parameters:
n - the new filter pattern to assign as a Number.

Copyright © 2005 Scientific Applications. All Rights Reserved.