# Class UCD

java.lang.Object
uk.ac.starlink.table.UCD

All Implemented Interfaces:
  `Comparable<UCD>`

public class UCD extends Object implements Comparable<UCD>
Describes Uniform Column Descriptors. This class knows about all currently defined UCDs, the Unified Column Descriptors defined by the CDS. Each UCD has a unique ID by which it is known, and a description giving a brief explanation of what it means.

UCDs are obtained from the static `getUCD(String)` method; any two UCDs with the same ID are guaranteed to be the same object.

## Source of information

The UCD ids and descriptions are read from a list at the resource `UCD_DEFINITIONS_LOC`. If this resource is unavailable at runtime, a warning will be written to the logging system. The original source of this text file was the CDS List of all UCDs.

Author:
  Mark Taylor (Starlink)
See Also:
  - Unified Content Descriptors

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`UCD_DEFINITIONS_LOC`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(UCD other)`
Implements the `Comparable` interface, comparing alphabetically by ID.
`String`
`getDescription()`
Returns the textual description of the UCD.
`String`
`getID()`
Returns the ID string of this UCD.
`static UCD`
`getUCD(String id)`
Returns the UCD object corresponding to a given UCD ID string.
`static Iterator<UCD>`
`getUCDs()`
Returns an iterator over all the known UCDs.
`String`
`toString()`
Returns the UCD id string.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### UCD_DEFINITIONS_LOC

public static final String UCD_DEFINITIONS_LOC

See Also:
  - Constant Field Values

## Method Details

### getID

public String getID()
Returns the ID string of this UCD.

Returns:
  the ID string (capitals, underscores and numbers only)

### getDescription

public String getDescription()
Returns the textual description of the UCD.

Returns:
  a few words describing the meaning of this UCD

### compareTo

public int compareTo(UCD other)
Implements the `Comparable` interface, comparing alphabetically by ID.

Specified by:
  `compareTo` in interface `Comparable<UCD>`

### getUCD

public static UCD getUCD(String id)
Returns the UCD object corresponding to a given UCD ID string. Returns `null` if no UCD with the given name is known.

Parameters:
  `id` - the string used to identify the UCD (it will have surrounding spaces trimmed)
Returns:
  the UCD object corresponding to `id`, or `null` if none can be found

### getUCDs

public static Iterator<UCD> getUCDs()
Returns an iterator over all the known UCDs. The iterator returns the UCDs in their natural order (alphabetic by ID).

Returns:
  an Iterator which iterates over all the existing `UCD` objects

### toString

public String toString()
Returns the UCD id string.

Overrides:
  `toString` in class `Object`
Returns:
  a string representation of this UCD