ICU 75.1 75.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions
icu::TimeUnit Class Reference

Measurement unit for time units. More...

#include <tmunit.h>

Inheritance diagram for icu::TimeUnit:
icu::MeasureUnit icu::UObject icu::UMemory

Public Types

enum  UTimeUnitFields {
  UTIMEUNIT_YEAR , UTIMEUNIT_MONTH , UTIMEUNIT_DAY , UTIMEUNIT_WEEK ,
  UTIMEUNIT_HOUR , UTIMEUNIT_MINUTE , UTIMEUNIT_SECOND , UTIMEUNIT_FIELD_COUNT
}
 Constants for all the time units we supported. More...
 

Public Member Functions

virtual TimeUnitclone () const override
 Override clone.
 
 TimeUnit (const TimeUnit &other)
 Copy operator.
 
TimeUnitoperator= (const TimeUnit &other)
 Assignment operator.
 
virtual UClassID getDynamicClassID () const override
 Returns a unique class ID for this object POLYMORPHICALLY.
 
UTimeUnitFields getTimeUnitField () const
 Get time unit field.
 
virtual ~TimeUnit ()
 Destructor.
 
- Public Member Functions inherited from icu::MeasureUnit
 MeasureUnit ()
 Default constructor.
 
 MeasureUnit (const MeasureUnit &other)
 Copy constructor.
 
 MeasureUnit (MeasureUnit &&other) noexcept
 Move constructor.
 
MeasureUnitoperator= (const MeasureUnit &other)
 Copy assignment operator.
 
MeasureUnitoperator= (MeasureUnit &&other) noexcept
 Move assignment operator.
 
virtual ~MeasureUnit ()
 Destructor.
 
virtual bool operator== (const UObject &other) const
 Equality operator.
 
bool operator!= (const UObject &other) const
 Inequality operator.
 
const chargetType () const
 Get the type.
 
const chargetSubtype () const
 Get the sub type.
 
const chargetIdentifier () const
 Get CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35.
 
UMeasureUnitComplexity getComplexity (UErrorCode &status) const
 Compute the complexity of the unit.
 
MeasureUnit withPrefix (UMeasurePrefix prefix, UErrorCode &status) const
 Creates a MeasureUnit which is this SINGLE unit augmented with the specified prefix.
 
UMeasurePrefix getPrefix (UErrorCode &status) const
 Returns the current SI or binary prefix of this SINGLE unit.
 
MeasureUnit withDimensionality (int32_t dimensionality, UErrorCode &status) const
 Creates a MeasureUnit which is this SINGLE unit augmented with the specified dimensionality (power).
 
int32_t getDimensionality (UErrorCode &status) const
 Gets the dimensionality (power) of this MeasureUnit.
 
MeasureUnit reciprocal (UErrorCode &status) const
 Gets the reciprocal of this MeasureUnit, with the numerator and denominator flipped.
 
MeasureUnit product (const MeasureUnit &other, UErrorCode &status) const
 Gets the product of this unit with another unit.
 
std::pair< LocalArray< MeasureUnit >, int32_tsplitToSingleUnits (UErrorCode &status) const
 Gets the list of SINGLE units contained within a MIXED or COMPOUND unit.
 
int32_t getOffset () const
 ICU use only.
 
- Public Member Functions inherited from icu::UObject
virtual ~UObject ()
 Destructor.
 

Static Public Member Functions

static TimeUnitcreateInstance (UTimeUnitFields timeUnitField, UErrorCode &status)
 Create Instance.
 
static UClassID getStaticClassID ()
 Returns the class ID for this class.
 
- Static Public Member Functions inherited from icu::MeasureUnit
static MeasureUnit forIdentifier (StringPiece identifier, UErrorCode &status)
 Construct a MeasureUnit from a CLDR Core Unit Identifier, defined in UTS.
 
static int32_t getAvailable (MeasureUnit *destArray, int32_t destCapacity, UErrorCode &errorCode)
 getAvailable gets all of the available units.
 
static int32_t getAvailable (const char *type, MeasureUnit *destArray, int32_t destCapacity, UErrorCode &errorCode)
 getAvailable gets all of the available units for a specific type.
 
static StringEnumerationgetAvailableTypes (UErrorCode &errorCode)
 getAvailableTypes gets all of the available types.
 
static UClassID getStaticClassID ()
 Return the class ID for this class.
 
static MeasureUnitcreateGForce (UErrorCode &status)
 Returns by pointer, unit of acceleration: g-force.
 
static MeasureUnit getGForce ()
 Returns by value, unit of acceleration: g-force.
 
static MeasureUnitcreateMeterPerSecondSquared (UErrorCode &status)
 Returns by pointer, unit of acceleration: meter-per-square-second.
 
static MeasureUnit getMeterPerSecondSquared ()
 Returns by value, unit of acceleration: meter-per-square-second.
 
static MeasureUnitcreateArcMinute (UErrorCode &status)
 Returns by pointer, unit of angle: arc-minute.
 
static MeasureUnit getArcMinute ()
 Returns by value, unit of angle: arc-minute.
 
static MeasureUnitcreateArcSecond (UErrorCode &status)
 Returns by pointer, unit of angle: arc-second.
 
static MeasureUnit getArcSecond ()
 Returns by value, unit of angle: arc-second.
 
static MeasureUnitcreateDegree (UErrorCode &status)
 Returns by pointer, unit of angle: degree.
 
static MeasureUnit getDegree ()
 Returns by value, unit of angle: degree.
 
static MeasureUnitcreateRadian (UErrorCode &status)
 Returns by pointer, unit of angle: radian.
 
static MeasureUnit getRadian ()
 Returns by value, unit of angle: radian.
 
static MeasureUnitcreateRevolutionAngle (UErrorCode &status)
 Returns by pointer, unit of angle: revolution.
 
static MeasureUnit getRevolutionAngle ()
 Returns by value, unit of angle: revolution.
 
static MeasureUnitcreateAcre (UErrorCode &status)
 Returns by pointer, unit of area: acre.
 
static MeasureUnit getAcre ()
 Returns by value, unit of area: acre.
 
static MeasureUnitcreateDunam (UErrorCode &status)
 Returns by pointer, unit of area: dunam.
 
static MeasureUnit getDunam ()
 Returns by value, unit of area: dunam.
 
static MeasureUnitcreateHectare (UErrorCode &status)
 Returns by pointer, unit of area: hectare.
 
static MeasureUnit getHectare ()
 Returns by value, unit of area: hectare.
 
static MeasureUnitcreateSquareCentimeter (UErrorCode &status)
 Returns by pointer, unit of area: square-centimeter.
 
static MeasureUnit getSquareCentimeter ()
 Returns by value, unit of area: square-centimeter.
 
static MeasureUnitcreateSquareFoot (UErrorCode &status)
 Returns by pointer, unit of area: square-foot.
 
static MeasureUnit getSquareFoot ()
 Returns by value, unit of area: square-foot.
 
static MeasureUnitcreateSquareInch (UErrorCode &status)
 Returns by pointer, unit of area: square-inch.
 
static MeasureUnit getSquareInch ()
 Returns by value, unit of area: square-inch.
 
static MeasureUnitcreateSquareKilometer (UErrorCode &status)
 Returns by pointer, unit of area: square-kilometer.
 
static MeasureUnit getSquareKilometer ()
 Returns by value, unit of area: square-kilometer.
 
static MeasureUnitcreateSquareMeter (UErrorCode &status)
 Returns by pointer, unit of area: square-meter.
 
static MeasureUnit getSquareMeter ()
 Returns by value, unit of area: square-meter.
 
static MeasureUnitcreateSquareMile (UErrorCode &status)
 Returns by pointer, unit of area: square-mile.
 
static MeasureUnit getSquareMile ()
 Returns by value, unit of area: square-mile.
 
static MeasureUnitcreateSquareYard (UErrorCode &status)
 Returns by pointer, unit of area: square-yard.
 
static MeasureUnit getSquareYard ()
 Returns by value, unit of area: square-yard.
 
static MeasureUnitcreateItem (UErrorCode &status)
 Returns by pointer, unit of concentr: item.
 
static MeasureUnit getItem ()
 Returns by value, unit of concentr: item.
 
static MeasureUnitcreateKarat (UErrorCode &status)
 Returns by pointer, unit of concentr: karat.
 
static MeasureUnit getKarat ()
 Returns by value, unit of concentr: karat.
 
static MeasureUnitcreateMilligramOfglucosePerDeciliter (UErrorCode &status)
 Returns by pointer, unit of concentr: milligram-ofglucose-per-deciliter.
 
static MeasureUnit getMilligramOfglucosePerDeciliter ()
 Returns by value, unit of concentr: milligram-ofglucose-per-deciliter.
 
static MeasureUnitcreateMilligramPerDeciliter (UErrorCode &status)
 Returns by pointer, unit of concentr: milligram-per-deciliter.
 
static MeasureUnit getMilligramPerDeciliter ()
 Returns by value, unit of concentr: milligram-per-deciliter.
 
static MeasureUnitcreateMillimolePerLiter (UErrorCode &status)
 Returns by pointer, unit of concentr: millimole-per-liter.
 
static MeasureUnit getMillimolePerLiter ()
 Returns by value, unit of concentr: millimole-per-liter.
 
static MeasureUnitcreateMole (UErrorCode &status)
 Returns by pointer, unit of concentr: mole.
 
static MeasureUnit getMole ()
 Returns by value, unit of concentr: mole.
 
static MeasureUnitcreatePercent (UErrorCode &status)
 Returns by pointer, unit of concentr: percent.
 
static MeasureUnit getPercent ()
 Returns by value, unit of concentr: percent.
 
static MeasureUnitcreatePermille (UErrorCode &status)
 Returns by pointer, unit of concentr: permille.
 
static MeasureUnit getPermille ()
 Returns by value, unit of concentr: permille.
 
static MeasureUnitcreatePartPerMillion (UErrorCode &status)
 Returns by pointer, unit of concentr: permillion.
 
static MeasureUnit getPartPerMillion ()
 Returns by value, unit of concentr: permillion.
 
static MeasureUnitcreatePermyriad (UErrorCode &status)
 Returns by pointer, unit of concentr: permyriad.
 
static MeasureUnit getPermyriad ()
 Returns by value, unit of concentr: permyriad.
 
static MeasureUnitcreateLiterPer100Kilometers (UErrorCode &status)
 Returns by pointer, unit of consumption: liter-per-100-kilometer.
 
static MeasureUnit getLiterPer100Kilometers ()
 Returns by value, unit of consumption: liter-per-100-kilometer.
 
static MeasureUnitcreateLiterPerKilometer (UErrorCode &status)
 Returns by pointer, unit of consumption: liter-per-kilometer.
 
static MeasureUnit getLiterPerKilometer ()
 Returns by value, unit of consumption: liter-per-kilometer.
 
static MeasureUnitcreateMilePerGallon (UErrorCode &status)
 Returns by pointer, unit of consumption: mile-per-gallon.
 
static MeasureUnit getMilePerGallon ()
 Returns by value, unit of consumption: mile-per-gallon.
 
static MeasureUnitcreateMilePerGallonImperial (UErrorCode &status)
 Returns by pointer, unit of consumption: mile-per-gallon-imperial.
 
static MeasureUnit getMilePerGallonImperial ()
 Returns by value, unit of consumption: mile-per-gallon-imperial.
 
static MeasureUnitcreateBit (UErrorCode &status)
 Returns by pointer, unit of digital: bit.
 
static MeasureUnit getBit ()
 Returns by value, unit of digital: bit.
 
static MeasureUnitcreateByte (UErrorCode &status)
 Returns by pointer, unit of digital: byte.
 
static MeasureUnit getByte ()
 Returns by value, unit of digital: byte.
 
static MeasureUnitcreateGigabit (UErrorCode &status)
 Returns by pointer, unit of digital: gigabit.
 
static MeasureUnit getGigabit ()
 Returns by value, unit of digital: gigabit.
 
static MeasureUnitcreateGigabyte (UErrorCode &status)
 Returns by pointer, unit of digital: gigabyte.
 
static MeasureUnit getGigabyte ()
 Returns by value, unit of digital: gigabyte.
 
static MeasureUnitcreateKilobit (UErrorCode &status)
 Returns by pointer, unit of digital: kilobit.
 
static MeasureUnit getKilobit ()
 Returns by value, unit of digital: kilobit.
 
static MeasureUnitcreateKilobyte (UErrorCode &status)
 Returns by pointer, unit of digital: kilobyte.
 
static MeasureUnit getKilobyte ()
 Returns by value, unit of digital: kilobyte.
 
static MeasureUnitcreateMegabit (UErrorCode &status)
 Returns by pointer, unit of digital: megabit.
 
static MeasureUnit getMegabit ()
 Returns by value, unit of digital: megabit.
 
static MeasureUnitcreateMegabyte (UErrorCode &status)
 Returns by pointer, unit of digital: megabyte.
 
static MeasureUnit getMegabyte ()
 Returns by value, unit of digital: megabyte.
 
static MeasureUnitcreatePetabyte (UErrorCode &status)
 Returns by pointer, unit of digital: petabyte.
 
static MeasureUnit getPetabyte ()
 Returns by value, unit of digital: petabyte.
 
static MeasureUnitcreateTerabit (UErrorCode &status)
 Returns by pointer, unit of digital: terabit.
 
static MeasureUnit getTerabit ()
 Returns by value, unit of digital: terabit.
 
static MeasureUnitcreateTerabyte (UErrorCode &status)
 Returns by pointer, unit of digital: terabyte.
 
static MeasureUnit getTerabyte ()
 Returns by value, unit of digital: terabyte.
 
static MeasureUnitcreateCentury (UErrorCode &status)
 Returns by pointer, unit of duration: century.
 
static MeasureUnit getCentury ()
 Returns by value, unit of duration: century.
 
static MeasureUnitcreateDay (UErrorCode &status)
 Returns by pointer, unit of duration: day.
 
static MeasureUnit getDay ()
 Returns by value, unit of duration: day.
 
static MeasureUnitcreateDayPerson (UErrorCode &status)
 Returns by pointer, unit of duration: day-person.
 
static MeasureUnit getDayPerson ()
 Returns by value, unit of duration: day-person.
 
static MeasureUnitcreateDecade (UErrorCode &status)
 Returns by pointer, unit of duration: decade.
 
static MeasureUnit getDecade ()
 Returns by value, unit of duration: decade.
 
static MeasureUnitcreateHour (UErrorCode &status)
 Returns by pointer, unit of duration: hour.
 
static MeasureUnit getHour ()
 Returns by value, unit of duration: hour.
 
static MeasureUnitcreateMicrosecond (UErrorCode &status)
 Returns by pointer, unit of duration: microsecond.
 
static MeasureUnit getMicrosecond ()
 Returns by value, unit of duration: microsecond.
 
static MeasureUnitcreateMillisecond (UErrorCode &status)
 Returns by pointer, unit of duration: millisecond.
 
static MeasureUnit getMillisecond ()
 Returns by value, unit of duration: millisecond.
 
static MeasureUnitcreateMinute (UErrorCode &status)
 Returns by pointer, unit of duration: minute.
 
static MeasureUnit getMinute ()
 Returns by value, unit of duration: minute.
 
static MeasureUnitcreateMonth (UErrorCode &status)
 Returns by pointer, unit of duration: month.
 
static MeasureUnit getMonth ()
 Returns by value, unit of duration: month.
 
static MeasureUnitcreateMonthPerson (UErrorCode &status)
 Returns by pointer, unit of duration: month-person.
 
static MeasureUnit getMonthPerson ()
 Returns by value, unit of duration: month-person.
 
static MeasureUnitcreateNanosecond (UErrorCode &status)
 Returns by pointer, unit of duration: nanosecond.
 
static MeasureUnit getNanosecond ()
 Returns by value, unit of duration: nanosecond.
 
static MeasureUnitcreateQuarter (UErrorCode &status)
 Returns by pointer, unit of duration: quarter.
 
static MeasureUnit getQuarter ()
 Returns by value, unit of duration: quarter.
 
static MeasureUnitcreateSecond (UErrorCode &status)
 Returns by pointer, unit of duration: second.
 
static MeasureUnit getSecond ()
 Returns by value, unit of duration: second.
 
static MeasureUnitcreateWeek (UErrorCode &status)
 Returns by pointer, unit of duration: week.
 
static MeasureUnit getWeek ()
 Returns by value, unit of duration: week.
 
static MeasureUnitcreateWeekPerson (UErrorCode &status)
 Returns by pointer, unit of duration: week-person.
 
static MeasureUnit getWeekPerson ()
 Returns by value, unit of duration: week-person.
 
static MeasureUnitcreateYear (UErrorCode &status)
 Returns by pointer, unit of duration: year.
 
static MeasureUnit getYear ()
 Returns by value, unit of duration: year.
 
static MeasureUnitcreateYearPerson (UErrorCode &status)
 Returns by pointer, unit of duration: year-person.
 
static MeasureUnit getYearPerson ()
 Returns by value, unit of duration: year-person.
 
static MeasureUnitcreateAmpere (UErrorCode &status)
 Returns by pointer, unit of electric: ampere.
 
static MeasureUnit getAmpere ()
 Returns by value, unit of electric: ampere.
 
static MeasureUnitcreateMilliampere (UErrorCode &status)
 Returns by pointer, unit of electric: milliampere.
 
static MeasureUnit getMilliampere ()
 Returns by value, unit of electric: milliampere.
 
static MeasureUnitcreateOhm (UErrorCode &status)
 Returns by pointer, unit of electric: ohm.
 
static MeasureUnit getOhm ()
 Returns by value, unit of electric: ohm.
 
static MeasureUnitcreateVolt (UErrorCode &status)
 Returns by pointer, unit of electric: volt.
 
static MeasureUnit getVolt ()
 Returns by value, unit of electric: volt.
 
static MeasureUnitcreateBritishThermalUnit (UErrorCode &status)
 Returns by pointer, unit of energy: british-thermal-unit.
 
static MeasureUnit getBritishThermalUnit ()
 Returns by value, unit of energy: british-thermal-unit.
 
static MeasureUnitcreateCalorie (UErrorCode &status)
 Returns by pointer, unit of energy: calorie.
 
static MeasureUnit getCalorie ()
 Returns by value, unit of energy: calorie.
 
static MeasureUnitcreateElectronvolt (UErrorCode &status)
 Returns by pointer, unit of energy: electronvolt.
 
static MeasureUnit getElectronvolt ()
 Returns by value, unit of energy: electronvolt.
 
static MeasureUnitcreateFoodcalorie (UErrorCode &status)
 Returns by pointer, unit of energy: foodcalorie.
 
static MeasureUnit getFoodcalorie ()
 Returns by value, unit of energy: foodcalorie.
 
static MeasureUnitcreateJoule (UErrorCode &status)
 Returns by pointer, unit of energy: joule.
 
static MeasureUnit getJoule ()
 Returns by value, unit of energy: joule.
 
static MeasureUnitcreateKilocalorie (UErrorCode &status)
 Returns by pointer, unit of energy: kilocalorie.
 
static MeasureUnit getKilocalorie ()
 Returns by value, unit of energy: kilocalorie.
 
static MeasureUnitcreateKilojoule (UErrorCode &status)
 Returns by pointer, unit of energy: kilojoule.
 
static MeasureUnit getKilojoule ()
 Returns by value, unit of energy: kilojoule.
 
static MeasureUnitcreateKilowattHour (UErrorCode &status)
 Returns by pointer, unit of energy: kilowatt-hour.
 
static MeasureUnit getKilowattHour ()
 Returns by value, unit of energy: kilowatt-hour.
 
static MeasureUnitcreateThermUs (UErrorCode &status)
 Returns by pointer, unit of energy: therm-us.
 
static MeasureUnit getThermUs ()
 Returns by value, unit of energy: therm-us.
 
static MeasureUnitcreateKilowattHourPer100Kilometer (UErrorCode &status)
 Returns by pointer, unit of force: kilowatt-hour-per-100-kilometer.
 
static MeasureUnit getKilowattHourPer100Kilometer ()
 Returns by value, unit of force: kilowatt-hour-per-100-kilometer.
 
static MeasureUnitcreateNewton (UErrorCode &status)
 Returns by pointer, unit of force: newton.
 
static MeasureUnit getNewton ()
 Returns by value, unit of force: newton.
 
static MeasureUnitcreatePoundForce (UErrorCode &status)
 Returns by pointer, unit of force: pound-force.
 
static MeasureUnit getPoundForce ()
 Returns by value, unit of force: pound-force.
 
static MeasureUnitcreateGigahertz (UErrorCode &status)
 Returns by pointer, unit of frequency: gigahertz.
 
static MeasureUnit getGigahertz ()
 Returns by value, unit of frequency: gigahertz.
 
static MeasureUnitcreateHertz (UErrorCode &status)
 Returns by pointer, unit of frequency: hertz.
 
static MeasureUnit getHertz ()
 Returns by value, unit of frequency: hertz.
 
static MeasureUnitcreateKilohertz (UErrorCode &status)
 Returns by pointer, unit of frequency: kilohertz.
 
static MeasureUnit getKilohertz ()
 Returns by value, unit of frequency: kilohertz.
 
static MeasureUnitcreateMegahertz (UErrorCode &status)
 Returns by pointer, unit of frequency: megahertz.
 
static MeasureUnit getMegahertz ()
 Returns by value, unit of frequency: megahertz.
 
static MeasureUnitcreateDot (UErrorCode &status)
 Returns by pointer, unit of graphics: dot.
 
static MeasureUnit getDot ()
 Returns by value, unit of graphics: dot.
 
static MeasureUnitcreateDotPerCentimeter (UErrorCode &status)
 Returns by pointer, unit of graphics: dot-per-centimeter.
 
static MeasureUnit getDotPerCentimeter ()
 Returns by value, unit of graphics: dot-per-centimeter.
 
static MeasureUnitcreateDotPerInch (UErrorCode &status)
 Returns by pointer, unit of graphics: dot-per-inch.
 
static MeasureUnit getDotPerInch ()
 Returns by value, unit of graphics: dot-per-inch.
 
static MeasureUnitcreateEm (UErrorCode &status)
 Returns by pointer, unit of graphics: em.
 
static MeasureUnit getEm ()
 Returns by value, unit of graphics: em.
 
static MeasureUnitcreateMegapixel (UErrorCode &status)
 Returns by pointer, unit of graphics: megapixel.
 
static MeasureUnit getMegapixel ()
 Returns by value, unit of graphics: megapixel.
 
static MeasureUnitcreatePixel (UErrorCode &status)
 Returns by pointer, unit of graphics: pixel.
 
static MeasureUnit getPixel ()
 Returns by value, unit of graphics: pixel.
 
static MeasureUnitcreatePixelPerCentimeter (UErrorCode &status)
 Returns by pointer, unit of graphics: pixel-per-centimeter.
 
static MeasureUnit getPixelPerCentimeter ()
 Returns by value, unit of graphics: pixel-per-centimeter.
 
static MeasureUnitcreatePixelPerInch (UErrorCode &status)
 Returns by pointer, unit of graphics: pixel-per-inch.
 
static MeasureUnit getPixelPerInch ()
 Returns by value, unit of graphics: pixel-per-inch.
 
static MeasureUnitcreateAstronomicalUnit (UErrorCode &status)
 Returns by pointer, unit of length: astronomical-unit.
 
static MeasureUnit getAstronomicalUnit ()
 Returns by value, unit of length: astronomical-unit.
 
static MeasureUnitcreateCentimeter (UErrorCode &status)
 Returns by pointer, unit of length: centimeter.
 
static MeasureUnit getCentimeter ()
 Returns by value, unit of length: centimeter.
 
static MeasureUnitcreateDecimeter (UErrorCode &status)
 Returns by pointer, unit of length: decimeter.
 
static MeasureUnit getDecimeter ()
 Returns by value, unit of length: decimeter.
 
static MeasureUnitcreateEarthRadius (UErrorCode &status)
 Returns by pointer, unit of length: earth-radius.
 
static MeasureUnit getEarthRadius ()
 Returns by value, unit of length: earth-radius.
 
static MeasureUnitcreateFathom (UErrorCode &status)
 Returns by pointer, unit of length: fathom.
 
static MeasureUnit getFathom ()
 Returns by value, unit of length: fathom.
 
static MeasureUnitcreateFoot (UErrorCode &status)
 Returns by pointer, unit of length: foot.
 
static MeasureUnit getFoot ()
 Returns by value, unit of length: foot.
 
static MeasureUnitcreateFurlong (UErrorCode &status)
 Returns by pointer, unit of length: furlong.
 
static MeasureUnit getFurlong ()
 Returns by value, unit of length: furlong.
 
static MeasureUnitcreateInch (UErrorCode &status)
 Returns by pointer, unit of length: inch.
 
static MeasureUnit getInch ()
 Returns by value, unit of length: inch.
 
static MeasureUnitcreateKilometer (UErrorCode &status)
 Returns by pointer, unit of length: kilometer.
 
static MeasureUnit getKilometer ()
 Returns by value, unit of length: kilometer.
 
static MeasureUnitcreateLightYear (UErrorCode &status)
 Returns by pointer, unit of length: light-year.
 
static MeasureUnit getLightYear ()
 Returns by value, unit of length: light-year.
 
static MeasureUnitcreateMeter (UErrorCode &status)
 Returns by pointer, unit of length: meter.
 
static MeasureUnit getMeter ()
 Returns by value, unit of length: meter.
 
static MeasureUnitcreateMicrometer (UErrorCode &status)
 Returns by pointer, unit of length: micrometer.
 
static MeasureUnit getMicrometer ()
 Returns by value, unit of length: micrometer.
 
static MeasureUnitcreateMile (UErrorCode &status)
 Returns by pointer, unit of length: mile.
 
static MeasureUnit getMile ()
 Returns by value, unit of length: mile.
 
static MeasureUnitcreateMileScandinavian (UErrorCode &status)
 Returns by pointer, unit of length: mile-scandinavian.
 
static MeasureUnit getMileScandinavian ()
 Returns by value, unit of length: mile-scandinavian.
 
static MeasureUnitcreateMillimeter (UErrorCode &status)
 Returns by pointer, unit of length: millimeter.
 
static MeasureUnit getMillimeter ()
 Returns by value, unit of length: millimeter.
 
static MeasureUnitcreateNanometer (UErrorCode &status)
 Returns by pointer, unit of length: nanometer.
 
static MeasureUnit getNanometer ()
 Returns by value, unit of length: nanometer.
 
static MeasureUnitcreateNauticalMile (UErrorCode &status)
 Returns by pointer, unit of length: nautical-mile.
 
static MeasureUnit getNauticalMile ()
 Returns by value, unit of length: nautical-mile.
 
static MeasureUnitcreateParsec (UErrorCode &status)
 Returns by pointer, unit of length: parsec.
 
static MeasureUnit getParsec ()
 Returns by value, unit of length: parsec.
 
static MeasureUnitcreatePicometer (UErrorCode &status)
 Returns by pointer, unit of length: picometer.
 
static MeasureUnit getPicometer ()
 Returns by value, unit of length: picometer.
 
static MeasureUnitcreatePoint (UErrorCode &status)
 Returns by pointer, unit of length: point.
 
static MeasureUnit getPoint ()
 Returns by value, unit of length: point.
 
static MeasureUnitcreateSolarRadius (UErrorCode &status)
 Returns by pointer, unit of length: solar-radius.
 
static MeasureUnit getSolarRadius ()
 Returns by value, unit of length: solar-radius.
 
static MeasureUnitcreateYard (UErrorCode &status)
 Returns by pointer, unit of length: yard.
 
static MeasureUnit getYard ()
 Returns by value, unit of length: yard.
 
static MeasureUnitcreateCandela (UErrorCode &status)
 Returns by pointer, unit of light: candela.
 
static MeasureUnit getCandela ()
 Returns by value, unit of light: candela.
 
static MeasureUnitcreateLumen (UErrorCode &status)
 Returns by pointer, unit of light: lumen.
 
static MeasureUnit getLumen ()
 Returns by value, unit of light: lumen.
 
static MeasureUnitcreateLux (UErrorCode &status)
 Returns by pointer, unit of light: lux.
 
static MeasureUnit getLux ()
 Returns by value, unit of light: lux.
 
static MeasureUnitcreateSolarLuminosity (UErrorCode &status)
 Returns by pointer, unit of light: solar-luminosity.
 
static MeasureUnit getSolarLuminosity ()
 Returns by value, unit of light: solar-luminosity.
 
static MeasureUnitcreateCarat (UErrorCode &status)
 Returns by pointer, unit of mass: carat.
 
static MeasureUnit getCarat ()
 Returns by value, unit of mass: carat.
 
static MeasureUnitcreateDalton (UErrorCode &status)
 Returns by pointer, unit of mass: dalton.
 
static MeasureUnit getDalton ()
 Returns by value, unit of mass: dalton.
 
static MeasureUnitcreateEarthMass (UErrorCode &status)
 Returns by pointer, unit of mass: earth-mass.
 
static MeasureUnit getEarthMass ()
 Returns by value, unit of mass: earth-mass.
 
static MeasureUnitcreateGrain (UErrorCode &status)
 Returns by pointer, unit of mass: grain.
 
static MeasureUnit getGrain ()
 Returns by value, unit of mass: grain.
 
static MeasureUnitcreateGram (UErrorCode &status)
 Returns by pointer, unit of mass: gram.
 
static MeasureUnit getGram ()
 Returns by value, unit of mass: gram.
 
static MeasureUnitcreateKilogram (UErrorCode &status)
 Returns by pointer, unit of mass: kilogram.
 
static MeasureUnit getKilogram ()
 Returns by value, unit of mass: kilogram.
 
static MeasureUnitcreateMetricTon (UErrorCode &status)
 Returns by pointer, unit of mass: metric-ton (renamed to tonne in CLDR 42 / ICU 72).
 
static MeasureUnit getMetricTon ()
 Returns by value, unit of mass: metric-ton (renamed to tonne in CLDR 42 / ICU 72).
 
static MeasureUnitcreateMicrogram (UErrorCode &status)
 Returns by pointer, unit of mass: microgram.
 
static MeasureUnit getMicrogram ()
 Returns by value, unit of mass: microgram.
 
static MeasureUnitcreateMilligram (UErrorCode &status)
 Returns by pointer, unit of mass: milligram.
 
static MeasureUnit getMilligram ()
 Returns by value, unit of mass: milligram.
 
static MeasureUnitcreateOunce (UErrorCode &status)
 Returns by pointer, unit of mass: ounce.
 
static MeasureUnit getOunce ()
 Returns by value, unit of mass: ounce.
 
static MeasureUnitcreateOunceTroy (UErrorCode &status)
 Returns by pointer, unit of mass: ounce-troy.
 
static MeasureUnit getOunceTroy ()
 Returns by value, unit of mass: ounce-troy.
 
static MeasureUnitcreatePound (UErrorCode &status)
 Returns by pointer, unit of mass: pound.
 
static MeasureUnit getPound ()
 Returns by value, unit of mass: pound.
 
static MeasureUnitcreateSolarMass (UErrorCode &status)
 Returns by pointer, unit of mass: solar-mass.
 
static MeasureUnit getSolarMass ()
 Returns by value, unit of mass: solar-mass.
 
static MeasureUnitcreateStone (UErrorCode &status)
 Returns by pointer, unit of mass: stone.
 
static MeasureUnit getStone ()
 Returns by value, unit of mass: stone.
 
static MeasureUnitcreateTon (UErrorCode &status)
 Returns by pointer, unit of mass: ton.
 
static MeasureUnit getTon ()
 Returns by value, unit of mass: ton.
 
static MeasureUnitcreateTonne (UErrorCode &status)
 Returns by pointer, unit of mass: tonne.
 
static MeasureUnit getTonne ()
 Returns by value, unit of mass: tonne.
 
static MeasureUnitcreateGigawatt (UErrorCode &status)
 Returns by pointer, unit of power: gigawatt.
 
static MeasureUnit getGigawatt ()
 Returns by value, unit of power: gigawatt.
 
static MeasureUnitcreateHorsepower (UErrorCode &status)
 Returns by pointer, unit of power: horsepower.
 
static MeasureUnit getHorsepower ()
 Returns by value, unit of power: horsepower.
 
static MeasureUnitcreateKilowatt (UErrorCode &status)
 Returns by pointer, unit of power: kilowatt.
 
static MeasureUnit getKilowatt ()
 Returns by value, unit of power: kilowatt.
 
static MeasureUnitcreateMegawatt (UErrorCode &status)
 Returns by pointer, unit of power: megawatt.
 
static MeasureUnit getMegawatt ()
 Returns by value, unit of power: megawatt.
 
static MeasureUnitcreateMilliwatt (UErrorCode &status)
 Returns by pointer, unit of power: milliwatt.
 
static MeasureUnit getMilliwatt ()
 Returns by value, unit of power: milliwatt.
 
static MeasureUnitcreateWatt (UErrorCode &status)
 Returns by pointer, unit of power: watt.
 
static MeasureUnit getWatt ()
 Returns by value, unit of power: watt.
 
static MeasureUnitcreateAtmosphere (UErrorCode &status)
 Returns by pointer, unit of pressure: atmosphere.
 
static MeasureUnit getAtmosphere ()
 Returns by value, unit of pressure: atmosphere.
 
static MeasureUnitcreateBar (UErrorCode &status)
 Returns by pointer, unit of pressure: bar.
 
static MeasureUnit getBar ()
 Returns by value, unit of pressure: bar.
 
static MeasureUnitcreateGasolineEnergyDensity (UErrorCode &status)
 Returns by pointer, unit of pressure: gasoline-energy-density.
 
static MeasureUnit getGasolineEnergyDensity ()
 Returns by value, unit of pressure: gasoline-energy-density.
 
static MeasureUnitcreateHectopascal (UErrorCode &status)
 Returns by pointer, unit of pressure: hectopascal.
 
static MeasureUnit getHectopascal ()
 Returns by value, unit of pressure: hectopascal.
 
static MeasureUnitcreateInchHg (UErrorCode &status)
 Returns by pointer, unit of pressure: inch-ofhg.
 
static MeasureUnit getInchHg ()
 Returns by value, unit of pressure: inch-ofhg.
 
static MeasureUnitcreateKilopascal (UErrorCode &status)
 Returns by pointer, unit of pressure: kilopascal.
 
static MeasureUnit getKilopascal ()
 Returns by value, unit of pressure: kilopascal.
 
static MeasureUnitcreateMegapascal (UErrorCode &status)
 Returns by pointer, unit of pressure: megapascal.
 
static MeasureUnit getMegapascal ()
 Returns by value, unit of pressure: megapascal.
 
static MeasureUnitcreateMillibar (UErrorCode &status)
 Returns by pointer, unit of pressure: millibar.
 
static MeasureUnit getMillibar ()
 Returns by value, unit of pressure: millibar.
 
static MeasureUnitcreateMillimeterOfMercury (UErrorCode &status)
 Returns by pointer, unit of pressure: millimeter-ofhg.
 
static MeasureUnit getMillimeterOfMercury ()
 Returns by value, unit of pressure: millimeter-ofhg.
 
static MeasureUnitcreatePascal (UErrorCode &status)
 Returns by pointer, unit of pressure: pascal.
 
static MeasureUnit getPascal ()
 Returns by value, unit of pressure: pascal.
 
static MeasureUnitcreatePoundPerSquareInch (UErrorCode &status)
 Returns by pointer, unit of pressure: pound-force-per-square-inch.
 
static MeasureUnit getPoundPerSquareInch ()
 Returns by value, unit of pressure: pound-force-per-square-inch.
 
static MeasureUnitcreateBeaufort (UErrorCode &status)
 Returns by pointer, unit of speed: beaufort.
 
static MeasureUnit getBeaufort ()
 Returns by value, unit of speed: beaufort.
 
static MeasureUnitcreateKilometerPerHour (UErrorCode &status)
 Returns by pointer, unit of speed: kilometer-per-hour.
 
static MeasureUnit getKilometerPerHour ()
 Returns by value, unit of speed: kilometer-per-hour.
 
static MeasureUnitcreateKnot (UErrorCode &status)
 Returns by pointer, unit of speed: knot.
 
static MeasureUnit getKnot ()
 Returns by value, unit of speed: knot.
 
static MeasureUnitcreateMeterPerSecond (UErrorCode &status)
 Returns by pointer, unit of speed: meter-per-second.
 
static MeasureUnit getMeterPerSecond ()
 Returns by value, unit of speed: meter-per-second.
 
static MeasureUnitcreateMilePerHour (UErrorCode &status)
 Returns by pointer, unit of speed: mile-per-hour.
 
static MeasureUnit getMilePerHour ()
 Returns by value, unit of speed: mile-per-hour.
 
static MeasureUnitcreateCelsius (UErrorCode &status)
 Returns by pointer, unit of temperature: celsius.
 
static MeasureUnit getCelsius ()
 Returns by value, unit of temperature: celsius.
 
static MeasureUnitcreateFahrenheit (UErrorCode &status)
 Returns by pointer, unit of temperature: fahrenheit.
 
static MeasureUnit getFahrenheit ()
 Returns by value, unit of temperature: fahrenheit.
 
static MeasureUnitcreateGenericTemperature (UErrorCode &status)
 Returns by pointer, unit of temperature: generic.
 
static MeasureUnit getGenericTemperature ()
 Returns by value, unit of temperature: generic.
 
static MeasureUnitcreateKelvin (UErrorCode &status)
 Returns by pointer, unit of temperature: kelvin.
 
static MeasureUnit getKelvin ()
 Returns by value, unit of temperature: kelvin.
 
static MeasureUnitcreateNewtonMeter (UErrorCode &status)
 Returns by pointer, unit of torque: newton-meter.
 
static MeasureUnit getNewtonMeter ()
 Returns by value, unit of torque: newton-meter.
 
static MeasureUnitcreatePoundFoot (UErrorCode &status)
 Returns by pointer, unit of torque: pound-force-foot.
 
static MeasureUnit getPoundFoot ()
 Returns by value, unit of torque: pound-force-foot.
 
static MeasureUnitcreateAcreFoot (UErrorCode &status)
 Returns by pointer, unit of volume: acre-foot.
 
static MeasureUnit getAcreFoot ()
 Returns by value, unit of volume: acre-foot.
 
static MeasureUnitcreateBarrel (UErrorCode &status)
 Returns by pointer, unit of volume: barrel.
 
static MeasureUnit getBarrel ()
 Returns by value, unit of volume: barrel.
 
static MeasureUnitcreateBushel (UErrorCode &status)
 Returns by pointer, unit of volume: bushel.
 
static MeasureUnit getBushel ()
 Returns by value, unit of volume: bushel.
 
static MeasureUnitcreateCentiliter (UErrorCode &status)
 Returns by pointer, unit of volume: centiliter.
 
static MeasureUnit getCentiliter ()
 Returns by value, unit of volume: centiliter.
 
static MeasureUnitcreateCubicCentimeter (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-centimeter.
 
static MeasureUnit getCubicCentimeter ()
 Returns by value, unit of volume: cubic-centimeter.
 
static MeasureUnitcreateCubicFoot (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-foot.
 
static MeasureUnit getCubicFoot ()
 Returns by value, unit of volume: cubic-foot.
 
static MeasureUnitcreateCubicInch (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-inch.
 
static MeasureUnit getCubicInch ()
 Returns by value, unit of volume: cubic-inch.
 
static MeasureUnitcreateCubicKilometer (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-kilometer.
 
static MeasureUnit getCubicKilometer ()
 Returns by value, unit of volume: cubic-kilometer.
 
static MeasureUnitcreateCubicMeter (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-meter.
 
static MeasureUnit getCubicMeter ()
 Returns by value, unit of volume: cubic-meter.
 
static MeasureUnitcreateCubicMile (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-mile.
 
static MeasureUnit getCubicMile ()
 Returns by value, unit of volume: cubic-mile.
 
static MeasureUnitcreateCubicYard (UErrorCode &status)
 Returns by pointer, unit of volume: cubic-yard.
 
static MeasureUnit getCubicYard ()
 Returns by value, unit of volume: cubic-yard.
 
static MeasureUnitcreateCup (UErrorCode &status)
 Returns by pointer, unit of volume: cup.
 
static MeasureUnit getCup ()
 Returns by value, unit of volume: cup.
 
static MeasureUnitcreateCupMetric (UErrorCode &status)
 Returns by pointer, unit of volume: cup-metric.
 
static MeasureUnit getCupMetric ()
 Returns by value, unit of volume: cup-metric.
 
static MeasureUnitcreateDeciliter (UErrorCode &status)
 Returns by pointer, unit of volume: deciliter.
 
static MeasureUnit getDeciliter ()
 Returns by value, unit of volume: deciliter.
 
static MeasureUnitcreateDessertSpoon (UErrorCode &status)
 Returns by pointer, unit of volume: dessert-spoon.
 
static MeasureUnit getDessertSpoon ()
 Returns by value, unit of volume: dessert-spoon.
 
static MeasureUnitcreateDessertSpoonImperial (UErrorCode &status)
 Returns by pointer, unit of volume: dessert-spoon-imperial.
 
static MeasureUnit getDessertSpoonImperial ()
 Returns by value, unit of volume: dessert-spoon-imperial.
 
static MeasureUnitcreateDram (UErrorCode &status)
 Returns by pointer, unit of volume: dram.
 
static MeasureUnit getDram ()
 Returns by value, unit of volume: dram.
 
static MeasureUnitcreateDrop (UErrorCode &status)
 Returns by pointer, unit of volume: drop.
 
static MeasureUnit getDrop ()
 Returns by value, unit of volume: drop.
 
static MeasureUnitcreateFluidOunce (UErrorCode &status)
 Returns by pointer, unit of volume: fluid-ounce.
 
static MeasureUnit getFluidOunce ()
 Returns by value, unit of volume: fluid-ounce.
 
static MeasureUnitcreateFluidOunceImperial (UErrorCode &status)
 Returns by pointer, unit of volume: fluid-ounce-imperial.
 
static MeasureUnit getFluidOunceImperial ()
 Returns by value, unit of volume: fluid-ounce-imperial.
 
static MeasureUnitcreateGallon (UErrorCode &status)
 Returns by pointer, unit of volume: gallon.
 
static MeasureUnit getGallon ()
 Returns by value, unit of volume: gallon.
 
static MeasureUnitcreateGallonImperial (UErrorCode &status)
 Returns by pointer, unit of volume: gallon-imperial.
 
static MeasureUnit getGallonImperial ()
 Returns by value, unit of volume: gallon-imperial.
 
static MeasureUnitcreateHectoliter (UErrorCode &status)
 Returns by pointer, unit of volume: hectoliter.
 
static MeasureUnit getHectoliter ()
 Returns by value, unit of volume: hectoliter.
 
static MeasureUnitcreateJigger (UErrorCode &status)
 Returns by pointer, unit of volume: jigger.
 
static MeasureUnit getJigger ()
 Returns by value, unit of volume: jigger.
 
static MeasureUnitcreateLiter (UErrorCode &status)
 Returns by pointer, unit of volume: liter.
 
static MeasureUnit getLiter ()
 Returns by value, unit of volume: liter.
 
static MeasureUnitcreateMegaliter (UErrorCode &status)
 Returns by pointer, unit of volume: megaliter.
 
static MeasureUnit getMegaliter ()
 Returns by value, unit of volume: megaliter.
 
static MeasureUnitcreateMilliliter (UErrorCode &status)
 Returns by pointer, unit of volume: milliliter.
 
static MeasureUnit getMilliliter ()
 Returns by value, unit of volume: milliliter.
 
static MeasureUnitcreatePinch (UErrorCode &status)
 Returns by pointer, unit of volume: pinch.
 
static MeasureUnit getPinch ()
 Returns by value, unit of volume: pinch.
 
static MeasureUnitcreatePint (UErrorCode &status)
 Returns by pointer, unit of volume: pint.
 
static MeasureUnit getPint ()
 Returns by value, unit of volume: pint.
 
static MeasureUnitcreatePintMetric (UErrorCode &status)
 Returns by pointer, unit of volume: pint-metric.
 
static MeasureUnit getPintMetric ()
 Returns by value, unit of volume: pint-metric.
 
static MeasureUnitcreateQuart (UErrorCode &status)
 Returns by pointer, unit of volume: quart.
 
static MeasureUnit getQuart ()
 Returns by value, unit of volume: quart.
 
static MeasureUnitcreateQuartImperial (UErrorCode &status)
 Returns by pointer, unit of volume: quart-imperial.
 
static MeasureUnit getQuartImperial ()
 Returns by value, unit of volume: quart-imperial.
 
static MeasureUnitcreateTablespoon (UErrorCode &status)
 Returns by pointer, unit of volume: tablespoon.
 
static MeasureUnit getTablespoon ()
 Returns by value, unit of volume: tablespoon.
 
static MeasureUnitcreateTeaspoon (UErrorCode &status)
 Returns by pointer, unit of volume: teaspoon.
 
static MeasureUnit getTeaspoon ()
 Returns by value, unit of volume: teaspoon.
 

Additional Inherited Members

- Protected Member Functions inherited from icu::MeasureUnit
void initTime (const char *timeId)
 For ICU use only.
 
void initCurrency (StringPiece isoCurrency)
 For ICU use only.
 

Detailed Description

Measurement unit for time units.

See also
TimeUnitAmount
TimeUnit
Stable:
ICU 4.2

Definition at line 35 of file tmunit.h.

Member Enumeration Documentation

◆ UTimeUnitFields

Constants for all the time units we supported.

Stable:
ICU 4.2
Enumerator
UTIMEUNIT_FIELD_COUNT 

One more than the highest normal UTimeUnitFields value.

Deprecated:
ICU 58 The numeric value may change over time, see ICU ticket #12420.

Definition at line 41 of file tmunit.h.

Constructor & Destructor Documentation

◆ TimeUnit()

icu::TimeUnit::TimeUnit ( const TimeUnit other)

Copy operator.

Stable:
ICU 4.2

◆ ~TimeUnit()

virtual icu::TimeUnit::~TimeUnit ( )
virtual

Destructor.

Stable:
ICU 4.2

Member Function Documentation

◆ clone()

virtual TimeUnit * icu::TimeUnit::clone ( ) const
overridevirtual

Override clone.

Stable:
ICU 4.2

Reimplemented from icu::MeasureUnit.

◆ createInstance()

static TimeUnit * icu::TimeUnit::createInstance ( UTimeUnitFields  timeUnitField,
UErrorCode status 
)
static

Create Instance.

Parameters
timeUnitFieldtime unit field based on which the instance is created.
statusinput-output error code. If the timeUnitField is invalid, then this will be set to U_ILLEGAL_ARGUMENT_ERROR.
Returns
a TimeUnit instance
Stable:
ICU 4.2

◆ getDynamicClassID()

virtual UClassID icu::TimeUnit::getDynamicClassID ( ) const
overridevirtual

Returns a unique class ID for this object POLYMORPHICALLY.

This method implements a simple form of RTTI used by ICU.

Returns
The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs.
Stable:
ICU 4.2

Reimplemented from icu::MeasureUnit.

◆ getStaticClassID()

static UClassID icu::TimeUnit::getStaticClassID ( )
static

Returns the class ID for this class.

This is used to compare to the return value of getDynamicClassID().

Returns
The class ID for all objects of this class.
Stable:
ICU 4.2

◆ getTimeUnitField()

UTimeUnitFields icu::TimeUnit::getTimeUnitField ( ) const

Get time unit field.

Returns
time unit field.
Stable:
ICU 4.2

◆ operator=()

TimeUnit & icu::TimeUnit::operator= ( const TimeUnit other)

Assignment operator.

Stable:
ICU 4.2

The documentation for this class was generated from the following file: