public final class AdvertisementSearch_Simple extends Object implements AdvertisementSearchInterface
AdvertisementSearch_Simple
object is an implimentation of the AdvertisementSearchInterface
interface. It is used to search for a particular advertisement as defined by an AdvertisementDescriptor
. The search is defined by a single string which must be of the following form: searchString ::= element { "&&" element } element ::= property { "=" value }The match() method will return true iff each of the listed properties is in the AdvertisementDescriptor, and if there's a corresponding value part, the value is equal (using a string comparison).
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Class and Description |
---|---|
(package private) class |
AdvertisementSearch_Simple.Pair |
Modifier and Type | Field and Description |
---|---|
private String |
searchString |
private AdvertisementSearch_Simple.Pair[] |
table |
Constructor and Description |
---|
AdvertisementSearch_Simple() |
AdvertisementSearch_Simple(String newSearchString) |
Modifier and Type | Method and Description |
---|---|
String |
getSearchString() |
private void |
init(String s) |
boolean |
match(AdvertisementDescriptor advertisement)
Determines whether the given advertisement is matched by this search.
|
void |
setSearchString(String newSearchString) |
private String searchString
private AdvertisementSearch_Simple.Pair[] table
public AdvertisementSearch_Simple()
public AdvertisementSearch_Simple(String newSearchString)
public String getSearchString()
public void setSearchString(String newSearchString)
newSearchString
- public boolean match(AdvertisementDescriptor advertisement)
AdvertisementSearchInterface
match
in interface AdvertisementSearchInterface
advertisement
- The advertisement that should be judged.true
if the specified advertisement is matched by
this search; false
otherwise.private void init(String s)