Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

dbbi.h

Go to the documentation of this file.
00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 1999-2001 IBM Corp. All rights reserved.
00004 **********************************************************************
00005 *   Date        Name        Description
00006 *   12/1/99    rgillam     Complete port from Java.
00007 *   01/13/2000 helena      Added UErrorCode to ctors.
00008 **********************************************************************
00009 */
00010 
00011 #ifndef DBBI_H
00012 #define DBBI_H
00013 
00014 #include "unicode/rbbi.h"
00015 
00016 /* forward declaration */
00017 class DictionaryBasedBreakIteratorTables;
00018 
00047 class U_I18N_API DictionaryBasedBreakIterator : public RuleBasedBreakIterator {
00048 
00049 private:
00054     int32_t dictionaryCharCount;
00055 
00062     int32_t* cachedBreakPositions;
00063 
00067     int32_t numCachedBreakPositions;
00068 
00073     int32_t positionInCache;
00074 
00078     static char fgClassID;
00079 
00080 public:
00094  private:
00095     DictionaryBasedBreakIterator(UDataMemory* tablesImage, char* dictionaryFilename, UErrorCode& status);
00096  public:
00097     //=======================================================================
00098     // boilerplate
00099     //=======================================================================
00100 
00104     virtual ~DictionaryBasedBreakIterator();
00105 
00110     DictionaryBasedBreakIterator& operator=(const DictionaryBasedBreakIterator& that);
00111 
00116     virtual BreakIterator* clone(void) const;
00117 
00118     //=======================================================================
00119     // BreakIterator overrides
00120     //=======================================================================
00125     virtual int32_t previous(void);
00126 
00133     virtual int32_t following(int32_t offset);
00134 
00141     virtual int32_t preceding(int32_t offset);
00142 
00153     virtual UClassID getDynamicClassID(void) const;
00154 
00165     static UClassID getStaticClassID(void);
00166 
00167 protected:
00168     //=======================================================================
00169     // implementation
00170     //=======================================================================
00178     virtual int32_t handleNext(void);
00179 
00184     virtual void reset(void);
00185 
00186         virtual BreakIterator *  createBufferClone(void *stackBuffer,
00187                                                int32_t &BufferSize,
00188                                                UErrorCode &status);
00189 
00190 
00191 private:
00200     void divideUpDictionaryRange(int32_t startPos, int32_t endPos);
00201 
00206     void bumpDictionaryCharCount(void);
00207 
00208     /*
00209      * HSYS : Please revisit with Rich, the ctors of the DBBI class is currently
00210      * marked as private.
00211      */
00212     friend class DictionaryBasedBreakIteratorTables;
00213     friend class BreakIterator;
00214 };
00215 
00216 inline UClassID DictionaryBasedBreakIterator::getDynamicClassID(void) const {
00217     return RuleBasedBreakIterator::getStaticClassID();
00218 }
00219 
00220 inline UClassID DictionaryBasedBreakIterator::getStaticClassID(void) {
00221     return (UClassID)(&fgClassID);
00222 }
00223 
00224 inline void DictionaryBasedBreakIterator::bumpDictionaryCharCount(void) {
00225     ++dictionaryCharCount;
00226 }
00227 
00228 #endif

Generated at Tue Jun 12 14:03:55 2001 for ICU 1.8.1 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000