Well-Known Values

Static factories for the values every OsidPrimitive needs but no caller should have to spell out — the unknown, the infinite, and the constants.

Unknown

No OSID accessor returns null, so a primitive whose value is not known still has to be a primitive. Each one answers with unknown(): a value at the coarsest resolution the type allows, carrying the widest uncertainty, so nothing downstream mistakes it for a measurement.

static OsidPrimitive unknown()

Returns an unknown OsidPrimitive.

DateTime

An unknown instant. Every calendar implements it — the civil, cultural, historical, alternate, and martian ones alike.

unknown() · infinity()
Javadoc →

Duration

An unknown length of time.

unknown() · infinity() · random()
Javadoc →

Time

An unknown time of day — UTCTime, MeanSolarTime, and SolTime.

unknown()
Javadoc →

Coordinate

An unknown position.

unknown()
Javadoc →

Distance

An unknown distance: infinite resolution and infinite uncertainty.

unknown() · infinity() · random()
Javadoc →

Speed

An unknown distance over a second. A speed is a distance per one time unit and INFINITY has no seconds, so the unknown-ness rides on the distance.

unknown() · light()
Javadoc →

Infinite

The far end of the scale, for the open side of a range. A DateTime, a Duration, and a Distance each answer with infinity(). Speed has none — its time unit must be finite.

static OsidPrimitive infinity()

Returns an infinite OsidPrimitive.

Constants

Values worth naming once rather than retyping.

static Speed light()

Returns the speed of light in a vacuum: 299,792,458 meters per second. The value is exact — since 1983 the meter has been defined from it rather than measured against it.

Random

A value at a randomly chosen granularity, for exercising code that has to cope with any of them. Duration and Distance offer it.

static OsidPrimitive random()

Returns a random OsidPrimitive.