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

fieldpos.h

Go to the documentation of this file.
00001 /*
00002 ********************************************************************************
00003 *   Copyright (C) 1997-2001, International Business Machines
00004 *   Corporation and others.  All Rights Reserved.
00005 ********************************************************************************
00006 *
00007 * File FIELDPOS.H
00008 *
00009 * Modification History:
00010 *
00011 *   Date        Name        Description
00012 *   02/25/97    aliu        Converted from java.
00013 *   03/17/97    clhuang     Updated per Format implementation.
00014 *    07/17/98    stephen        Added default/copy ctors, and operators =, ==, !=
00015 ********************************************************************************
00016 */
00017 // *****************************************************************************
00018 // This file was generated from the java source file FieldPosition.java
00019 // *****************************************************************************
00020  
00021 #ifndef FIELDPOS_H
00022 #define FIELDPOS_H
00023 
00024 #include "unicode/utypes.h"
00025 
00026 #if !UCONFIG_NO_FORMATTING
00027 
00028 #include "unicode/uobject.h"
00029 
00030 U_NAMESPACE_BEGIN
00031 
00098 class U_I18N_API FieldPosition : public UObject {
00099 public:
00104     enum { DONT_CARE = -1 };
00105 
00110     FieldPosition() 
00111         : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
00112 
00124     FieldPosition(int32_t field) 
00125         : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
00126 
00132     FieldPosition(const FieldPosition& copy) 
00133         : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
00134 
00139     ~FieldPosition() {}
00140 
00146     FieldPosition&      operator=(const FieldPosition& copy);
00147 
00154     UBool              operator==(const FieldPosition& that) const;
00155 
00162     UBool              operator!=(const FieldPosition& that) const;
00163 
00169     int32_t getField(void) const { return fField; }
00170 
00176     int32_t getBeginIndex(void) const { return fBeginIndex; }
00177 
00185     int32_t getEndIndex(void) const { return fEndIndex; }
00186  
00192     void setField(int32_t f) { fField = f; }
00193 
00199     void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
00200 
00206     void setEndIndex(int32_t ei) { fEndIndex = ei; }
00207     
00213     virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
00214 
00220     static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
00221 
00222 private:
00227     int32_t fField;
00228 
00233     int32_t fBeginIndex;
00234 
00239     int32_t fEndIndex;
00240 
00245     static const char fgClassID;
00246 };
00247 
00248 inline FieldPosition&
00249 FieldPosition::operator=(const FieldPosition& copy)
00250 {
00251     fField         = copy.fField;
00252     fEndIndex     = copy.fEndIndex;
00253     fBeginIndex = copy.fBeginIndex;
00254     return *this;
00255 }
00256 
00257 inline UBool
00258 FieldPosition::operator==(const FieldPosition& copy) const
00259 {
00260     if(    fField         != copy.fField || 
00261         fEndIndex     != copy.fEndIndex ||
00262         fBeginIndex != copy.fBeginIndex) 
00263         return FALSE;
00264     else
00265         return TRUE;
00266 }
00267 
00268 inline UBool
00269 FieldPosition::operator!=(const FieldPosition& copy) const
00270 {
00271     return !operator==(copy);
00272 }
00273 
00274 U_NAMESPACE_END
00275 
00276 #endif /* #if !UCONFIG_NO_FORMATTING */
00277 
00278 #endif // _FIELDPOS
00279 //eof

Generated on Wed Dec 18 16:49:34 2002 for ICU 2.4 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001