ICU 4.8.1.1  4.8.1.1
fieldpos.h
Go to the documentation of this file.
00001 /*
00002  ********************************************************************************
00003  *   Copyright (C) 1997-2006, 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 // *****************************************************************************
00019 // This file was generated from the java source file FieldPosition.java
00020 // *****************************************************************************
00021  
00022 #ifndef FIELDPOS_H
00023 #define FIELDPOS_H
00024 
00025 #include "unicode/utypes.h"
00026 
00032 #if !UCONFIG_NO_FORMATTING
00033 
00034 #include "unicode/uobject.h"
00035 
00036 U_NAMESPACE_BEGIN
00037 
00106 class U_I18N_API FieldPosition : public UObject {
00107 public:
00112     enum { DONT_CARE = -1 };
00113 
00118     FieldPosition() 
00119         : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
00120 
00132     FieldPosition(int32_t field) 
00133         : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
00134 
00140     FieldPosition(const FieldPosition& copy) 
00141         : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
00142 
00147     virtual ~FieldPosition();
00148 
00154     FieldPosition&      operator=(const FieldPosition& copy);
00155 
00162     UBool              operator==(const FieldPosition& that) const;
00163 
00170     UBool              operator!=(const FieldPosition& that) const;
00171 
00183     FieldPosition *clone() const;
00184 
00190     int32_t getField(void) const { return fField; }
00191 
00197     int32_t getBeginIndex(void) const { return fBeginIndex; }
00198 
00206     int32_t getEndIndex(void) const { return fEndIndex; }
00207  
00213     void setField(int32_t f) { fField = f; }
00214 
00220     void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
00221 
00227     void setEndIndex(int32_t ei) { fEndIndex = ei; }
00228     
00234     virtual UClassID getDynamicClassID() const;
00235 
00241     static UClassID U_EXPORT2 getStaticClassID();
00242 
00243 private:
00248     int32_t fField;
00249 
00254     int32_t fBeginIndex;
00255 
00260     int32_t fEndIndex;
00261 };
00262 
00263 inline FieldPosition&
00264 FieldPosition::operator=(const FieldPosition& copy)
00265 {
00266     fField         = copy.fField;
00267     fEndIndex     = copy.fEndIndex;
00268     fBeginIndex = copy.fBeginIndex;
00269     return *this;
00270 }
00271 
00272 inline UBool
00273 FieldPosition::operator==(const FieldPosition& copy) const
00274 {
00275     return (fField == copy.fField &&
00276         fEndIndex == copy.fEndIndex &&
00277         fBeginIndex == copy.fBeginIndex);
00278 }
00279 
00280 inline UBool
00281 FieldPosition::operator!=(const FieldPosition& copy) const
00282 {
00283     return !operator==(copy);
00284 }
00285 
00286 U_NAMESPACE_END
00287 
00288 #endif /* #if !UCONFIG_NO_FORMATTING */
00289 
00290 #endif // _FIELDPOS
00291 //eof
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines