]> git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/unifltlg.h
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / unifltlg.h
1 /*
2 **********************************************************************
3 * Copyright (C) 1999, International Business Machines Corporation and others. All Rights Reserved.
4 **********************************************************************
5 * Date Name Description
6 * 11/17/99 aliu Creation.
7 **********************************************************************
8 */
9
10 //////////////////////////////////////////////////////////////
11 //
12 // NOTICE - Do not use
13 //
14 // This entire file has been marked obsolete as of ICU 2.4.
15 // This will be removed as of ICU 2.8. Use UnicodeSet methods instead.
16 //
17 //////////////////////////////////////////////////////////////
18
19 #ifndef UNIFLTLG_H
20 #define UNIFLTLG_H
21
22 #include "unicode/utypes.h"
23
24 #if !UCONFIG_NO_TRANSLITERATION
25
26 #include "unicode/uobject.h"
27
28 U_NAMESPACE_BEGIN
29
30 class UnicodeFilter;
31
32 /**
33 * <code>UnicodeFilterLogic</code> provides logical operators on
34 * {@link UnicodeFilter} objects. This class cannot be instantiated;
35 * it consists only of static methods. The static methods return
36 * filter objects that perform logical inversion (<tt>not</tt>),
37 * intersection (<tt>and</tt>), or union (<tt>or</tt>) of the given
38 * filter objects.
39 *
40 * If a UnicodeFilter* f is passed in, where f == NULL, then that
41 * is treated as a filter that contains all Unicode characters.
42 * Therefore, createNot(NULL) returns a filter that contains no
43 * Unicode characters. Likewise, createAnd(g, NULL) returns g->clone(),
44 * and createAnd(NULL, NULL) returns NULL.
45 *
46 * @obsolete ICU 2.8. Use UnicodeSet methods instead since this class will be removed in that release.
47 */
48 class U_I18N_API UnicodeFilterLogic /* not : public UObject because all methods are static */ {
49
50 public:
51
52 /**
53 * Returns a <tt>UnicodeFilter</tt> that implements the inverse of
54 * the given filter.
55 * @param f may be NULL
56 * @result always non-NULL
57 * @obsolete ICU 2.8. Use UnicodeSet methods instead since this class will be removed in that release.
58 */
59 static UnicodeFilter* createNot(const UnicodeFilter* f);
60
61 /**
62 * Returns a <tt>UnicodeFilter</tt> that implements a short
63 * circuit AND of the result of the two given filters. That is,
64 * if <tt>f.contains()</tt> is <tt>false</tt>, then <tt>g.contains()</tt>
65 * is not called, and <tt>contains()</tt> returns <tt>false</tt>.
66 * @param f may be NULL
67 * @param g may be NULL
68 * @result will be NULL if and only if f == g == NULL
69 * @obsolete ICU 2.8. Use UnicodeSet methods instead since this class will be removed in that release.
70 */
71 static UnicodeFilter* createAnd(const UnicodeFilter* f,
72 const UnicodeFilter* g);
73
74 /**
75 * Returns a <tt>UnicodeFilter</tt> that implements a short
76 * circuit AND of the result of the two given filters. That is,
77 * if <tt>f.contains()</tt> is <tt>false</tt>, then <tt>g.contains()</tt>
78 * is not called, and <tt>contains()</tt> returns <tt>false</tt>.
79 * @param adoptedF may be NULL; this argument is adopted
80 * @param adoptedG may be NULL; this argument is adopted
81 * @result will be NULL if and only if f == g == NULL
82 * @obsolete ICU 2.8. Use UnicodeSet methods instead since this class will be removed in that release.
83 */
84 static UnicodeFilter* createAdoptingAnd(UnicodeFilter* adoptedF,
85 UnicodeFilter* adoptedG);
86
87 /**
88 * Returns a <tt>UnicodeFilter</tt> that implements a short
89 * circuit OR of the result of the two given filters. That is, if
90 * <tt>f.contains()</tt> is <tt>true</tt>, then <tt>g.contains()</tt> is
91 * not called, and <tt>contains()</tt> returns <tt>true</tt>.
92 * @param f may be NULL
93 * @param g may be NULL
94 * @result will be NULL if and only if f == g == NULL
95 * @obsolete ICU 2.8. Use UnicodeSet methods instead since this class will be removed in that release.
96 */
97 static UnicodeFilter* createOr(const UnicodeFilter* f,
98 const UnicodeFilter* g);
99
100 private:
101 // Disallow instantiation
102 UnicodeFilterLogic();
103 };
104
105 inline UnicodeFilterLogic::UnicodeFilterLogic() {}
106
107 U_NAMESPACE_END
108
109 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
110
111 #endif