1999-12-28 23:57:50 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
2001-03-22 00:09:10 +00:00
|
|
|
* Copyright (C) 1999, International Business Machines Corporation and others. All Rights Reserved.
|
1999-12-28 23:57:50 +00:00
|
|
|
**********************************************************************
|
|
|
|
* Date Name Description
|
|
|
|
* 11/17/99 aliu Creation.
|
|
|
|
**********************************************************************
|
|
|
|
*/
|
2002-08-28 17:17:04 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// NOTICE - Do not use
|
|
|
|
//
|
|
|
|
// This entire file has been deprecated as of ICU 2.4.
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#ifndef UNIFLTLG_H
|
|
|
|
#define UNIFLTLG_H
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
2002-06-27 01:19:20 +00:00
|
|
|
#include "unicode/uobject.h"
|
1999-12-28 23:57:50 +00:00
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
class UnicodeFilter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* <code>UnicodeFilterLogic</code> provides logical operators on
|
|
|
|
* {@link UnicodeFilter} objects. This class cannot be instantiated;
|
|
|
|
* it consists only of static methods. The static methods return
|
|
|
|
* filter objects that perform logical inversion (<tt>not</tt>),
|
|
|
|
* intersection (<tt>and</tt>), or union (<tt>or</tt>) of the given
|
|
|
|
* filter objects.
|
2000-02-05 00:24:24 +00:00
|
|
|
*
|
|
|
|
* If a UnicodeFilter* f is passed in, where f == NULL, then that
|
|
|
|
* is treated as a filter that contains all Unicode characters.
|
|
|
|
* Therefore, createNot(NULL) returns a filter that contains no
|
|
|
|
* Unicode characters. Likewise, createAnd(g, NULL) returns g->clone(),
|
|
|
|
* and createAnd(NULL, NULL) returns NULL.
|
2002-08-28 17:17:04 +00:00
|
|
|
*
|
|
|
|
* @deprecated in ICU 2.4 2002-08/28. Use UnicodeSet methods instead.
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2002-06-29 00:04:16 +00:00
|
|
|
class U_I18N_API UnicodeFilterLogic /* not : public UObject because all methods are static */ {
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a <tt>UnicodeFilter</tt> that implements the inverse of
|
|
|
|
* the given filter.
|
2000-02-05 00:24:24 +00:00
|
|
|
* @param f may be NULL
|
|
|
|
* @result always non-NULL
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2000-02-05 00:24:24 +00:00
|
|
|
static UnicodeFilter* createNot(const UnicodeFilter* f);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a <tt>UnicodeFilter</tt> that implements a short
|
|
|
|
* circuit AND of the result of the two given filters. That is,
|
2000-01-18 20:00:56 +00:00
|
|
|
* if <tt>f.contains()</tt> is <tt>false</tt>, then <tt>g.contains()</tt>
|
|
|
|
* is not called, and <tt>contains()</tt> returns <tt>false</tt>.
|
2000-02-05 00:24:24 +00:00
|
|
|
* @param f may be NULL
|
|
|
|
* @param g may be NULL
|
|
|
|
* @result will be NULL if and only if f == g == NULL
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2000-02-05 00:24:24 +00:00
|
|
|
static UnicodeFilter* createAnd(const UnicodeFilter* f,
|
|
|
|
const UnicodeFilter* g);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
2001-10-24 13:34:11 +00:00
|
|
|
/**
|
|
|
|
* Returns a <tt>UnicodeFilter</tt> that implements a short
|
|
|
|
* circuit AND of the result of the two given filters. That is,
|
|
|
|
* if <tt>f.contains()</tt> is <tt>false</tt>, then <tt>g.contains()</tt>
|
|
|
|
* is not called, and <tt>contains()</tt> returns <tt>false</tt>.
|
2002-07-01 11:04:45 +00:00
|
|
|
* @param adoptedF may be NULL; this argument is adopted
|
|
|
|
* @param adoptedG may be NULL; this argument is adopted
|
2001-10-24 13:34:11 +00:00
|
|
|
* @result will be NULL if and only if f == g == NULL
|
|
|
|
*/
|
|
|
|
static UnicodeFilter* createAdoptingAnd(UnicodeFilter* adoptedF,
|
|
|
|
UnicodeFilter* adoptedG);
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
/**
|
|
|
|
* Returns a <tt>UnicodeFilter</tt> that implements a short
|
|
|
|
* circuit OR of the result of the two given filters. That is, if
|
2000-01-18 20:00:56 +00:00
|
|
|
* <tt>f.contains()</tt> is <tt>true</tt>, then <tt>g.contains()</tt> is
|
|
|
|
* not called, and <tt>contains()</tt> returns <tt>true</tt>.
|
2000-02-05 00:24:24 +00:00
|
|
|
* @param f may be NULL
|
|
|
|
* @param g may be NULL
|
|
|
|
* @result will be NULL if and only if f == g == NULL
|
1999-12-28 23:57:50 +00:00
|
|
|
*/
|
2000-02-05 00:24:24 +00:00
|
|
|
static UnicodeFilter* createOr(const UnicodeFilter* f,
|
|
|
|
const UnicodeFilter* g);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Disallow instantiation
|
|
|
|
UnicodeFilterLogic();
|
|
|
|
};
|
|
|
|
|
|
|
|
inline UnicodeFilterLogic::UnicodeFilterLogic() {}
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
U_NAMESPACE_END
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
#endif
|