/* ******************************************************************************** * Copyright (C) 1997-1999, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************** * * File FIELDPOS.H * * Modification History: * * Date Name Description * 02/25/97 aliu Converted from java. * 03/17/97 clhuang Updated per Format implementation. * 07/17/98 stephen Added default/copy ctors, and operators =, ==, != ******************************************************************************** */ // ***************************************************************************** // This file was generated from the java source file FieldPosition.java // ***************************************************************************** #ifndef FIELDPOS_H #define FIELDPOS_H #include "unicode/utypes.h" class U_I18N_API FieldPosition { public: enum { DONT_CARE = -1 }; FieldPosition() : fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {} FieldPosition(int32_t field) : fField(field), fBeginIndex(0), fEndIndex(0) {} FieldPosition(const FieldPosition& copy) : fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {} ~FieldPosition() {} FieldPosition& operator=(const FieldPosition& copy); bool_t operator==(const FieldPosition& that) const; bool_t operator!=(const FieldPosition& that) const; int32_t getField(void) const { return fField; } int32_t getBeginIndex(void) const { return fBeginIndex; } int32_t getEndIndex(void) const { return fEndIndex; } void setField(int32_t f) { fField = f; } void setBeginIndex(int32_t bi) { fBeginIndex = bi; } void setEndIndex(int32_t ei) { fEndIndex = ei; } private: int32_t fField; int32_t fEndIndex; int32_t fBeginIndex; }; inline FieldPosition& FieldPosition::operator=(const FieldPosition& copy) { fField = copy.fField; fEndIndex = copy.fEndIndex; fBeginIndex = copy.fBeginIndex; return *this; } inline bool_t FieldPosition::operator==(const FieldPosition& copy) const { if( fField != copy.fField || fEndIndex != copy.fEndIndex || fBeginIndex != copy.fBeginIndex) return FALSE; else return TRUE; } inline bool_t FieldPosition::operator!=(const FieldPosition& copy) const { return !operator==(copy); } #endif // _FIELDPOS //eof