00001 /* 00002 ******************************************************************************** 00003 * Copyright (C) 1997-1999, 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 00092 class U_I18N_API FieldPosition { 00093 public: 00098 enum { DONT_CARE = -1 }; 00099 00104 FieldPosition() 00105 : fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {} 00106 00118 FieldPosition(int32_t field) 00119 : fField(field), fBeginIndex(0), fEndIndex(0) {} 00120 00126 FieldPosition(const FieldPosition& copy) 00127 : fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {} 00128 00133 ~FieldPosition() {} 00134 00139 FieldPosition& operator=(const FieldPosition& copy); 00140 00146 UBool operator==(const FieldPosition& that) const; 00147 00153 UBool operator!=(const FieldPosition& that) const; 00154 00159 int32_t getField(void) const { return fField; } 00160 00165 int32_t getBeginIndex(void) const { return fBeginIndex; } 00166 00172 int32_t getEndIndex(void) const { return fEndIndex; } 00173 00178 void setField(int32_t f) { fField = f; } 00179 00184 void setBeginIndex(int32_t bi) { fBeginIndex = bi; } 00185 00190 void setEndIndex(int32_t ei) { fEndIndex = ei; } 00191 00192 private: 00197 int32_t fField; 00198 00203 int32_t fBeginIndex; 00204 00209 int32_t fEndIndex; 00210 }; 00211 00212 inline FieldPosition& 00213 FieldPosition::operator=(const FieldPosition& copy) 00214 { 00215 fField = copy.fField; 00216 fEndIndex = copy.fEndIndex; 00217 fBeginIndex = copy.fBeginIndex; 00218 return *this; 00219 } 00220 00221 inline UBool 00222 FieldPosition::operator==(const FieldPosition& copy) const 00223 { 00224 if( fField != copy.fField || 00225 fEndIndex != copy.fEndIndex || 00226 fBeginIndex != copy.fBeginIndex) 00227 return FALSE; 00228 else 00229 return TRUE; 00230 } 00231 00232 inline UBool 00233 FieldPosition::operator!=(const FieldPosition& copy) const 00234 { 00235 return !operator==(copy); 00236 } 00237 00238 #endif // _FIELDPOS 00239 //eof