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 #include "unicode/uobject.h"
00026 
00027 U_NAMESPACE_BEGIN
00028 
00095 class U_I18N_API FieldPosition : public UObject {
00096 public:
00101     enum { DONT_CARE = -1 };
00102 
00107     FieldPosition() 
00108         : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
00109 
00121     FieldPosition(int32_t field) 
00122         : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
00123 
00129     FieldPosition(const FieldPosition& copy) 
00130         : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
00131 
00136     ~FieldPosition() {}
00137 
00143     FieldPosition&      operator=(const FieldPosition& copy);
00144 
00151     UBool              operator==(const FieldPosition& that) const;
00152 
00159     UBool              operator!=(const FieldPosition& that) const;
00160 
00166     int32_t getField(void) const { return fField; }
00167 
00173     int32_t getBeginIndex(void) const { return fBeginIndex; }
00174 
00182     int32_t getEndIndex(void) const { return fEndIndex; }
00183  
00189     void setField(int32_t f) { fField = f; }
00190 
00196     void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
00197 
00203     void setEndIndex(int32_t ei) { fEndIndex = ei; }
00204     
00210     virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
00211 
00217     static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
00218 
00219 private:
00224     int32_t fField;
00225 
00230     int32_t fBeginIndex;
00231 
00236     int32_t fEndIndex;
00237 
00242     static const char fgClassID;
00243 };
00244 
00245 inline FieldPosition&
00246 FieldPosition::operator=(const FieldPosition& copy)
00247 {
00248     fField         = copy.fField;
00249     fEndIndex     = copy.fEndIndex;
00250     fBeginIndex = copy.fBeginIndex;
00251     return *this;
00252 }
00253 
00254 inline UBool
00255 FieldPosition::operator==(const FieldPosition& copy) const
00256 {
00257     if(    fField         != copy.fField || 
00258         fEndIndex     != copy.fEndIndex ||
00259         fBeginIndex != copy.fBeginIndex) 
00260         return FALSE;
00261     else
00262         return TRUE;
00263 }
00264 
00265 inline UBool
00266 FieldPosition::operator!=(const FieldPosition& copy) const
00267 {
00268     return !operator==(copy);
00269 }
00270 
00271 U_NAMESPACE_END
00272 
00273 #endif // _FIELDPOS
00274 //eof

Generated on Thu Aug 15 14:13:25 2002 for ICU 2.2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001