/* ********************************************************************** * Copyright © {1999}, International Business Machines Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description * 11/17/99 aliu Creation. ********************************************************************** */ #ifndef UNIFLTLG_H #define UNIFLTLG_H #include "unicode/utypes.h" class UnicodeFilter; /** * UnicodeFilterLogic 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 (not), * intersection (and), or union (or) of the given * filter objects. */ class U_I18N_API UnicodeFilterLogic { public: /** * Returns a UnicodeFilter that implements the inverse of * the given filter. */ static UnicodeFilter* createNot(const UnicodeFilter& f); /** * Returns a UnicodeFilter that implements a short * circuit AND of the result of the two given filters. That is, * if f.isIn() is false, then g.isIn() * is not called, and isIn() returns false. * *

Either f or g must be non-null. */ static UnicodeFilter* createAnd(const UnicodeFilter& f, const UnicodeFilter& g); /** * Returns a UnicodeFilter that implements a short * circuit AND of the result of the given filters. That is, if * f[i].isIn() is false, then * f[j].isIn() is not called, where j > i, and * isIn() returns false. */ // static UnicodeFilter* and(const UnicodeFilter** f); /** * Returns a UnicodeFilter that implements a short * circuit OR of the result of the two given filters. That is, if * f.isIn() is true, then g.isIn() is * not called, and isIn() returns true. * *

Either f or g must be non-null. */ static UnicodeFilter* createOr(const UnicodeFilter& f, const UnicodeFilter& g); /** * Returns a UnicodeFilter that implements a short * circuit OR of the result of the given filters. That is, if * f[i].isIn() is false, then * f[j].isIn() is not called, where j > i, and * isIn() returns true. */ // static UnicodeFilter* or(const UnicodeFilter** f); // TODO: Add nand() & nor() for convenience, if needed. private: // Disallow instantiation UnicodeFilterLogic(); }; inline UnicodeFilterLogic::UnicodeFilterLogic() {} #endif