# Enum Area.Type

java.lang.Object
java.lang.Enum<Area.Type>
uk.ac.starlink.ttools.Area.Type

All Implemented Interfaces:
  `Serializable, Comparable<Area.Type>, java.lang.constant.Constable`

Enclosing class:
  `Area`

public static enum Area.Type extends Enum<Area.Type>
Available shape types.

Since:
  27 Mar 2020
Author:
  Mark Taylor

## Nested Class Summary

### Nested classes/interfaces inherited from class Enum

`Enum.EnumDesc<E>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`CIRCLE`
Circle defined by central point and a radius (x, y, r).
`MOC`
Multi-Order Coverage map; each array element contains 64-bit NUNIQ bit pattern equivalenced to the double value.
`MULTISHAPE`
Collection of Area instances, to be considered as a union.
`POINT`
Point defined by two coordinates (x, y).
`POLYGON`
Polygon or sequence of polygons defined by a list of vertices (x1, y1, x2, y2, ..., xN, yN).

## Method Summary

Modifier and Type
Method
Description
`static Area.Type`
`fromInt(int itype)`
Retrieves an instance of this enum from its numeric code.
`abstract boolean`
`isLegalArrayLength(int n)`
Indicates whether a given data array length can represent a shape of this type.
`abstract long[]`
`toMocUniqs(double[] data, int level)`
Returns an array of UNIQ values corresponding to this shape for a given maximum HEALPix level.
`static Area.Type`
`valueOf(String name)`
Returns the enum constant of this type with the specified name.
`static Area.Type[]`
`values()`
Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### POLYGON

public static final Area.Type POLYGON
Polygon or sequence of polygons defined by a list of vertices (x1, y1, x2, y2, ..., xN, yN). If a coordinate pair (xA,yA) are both NaN, it indicates a break between polygons: so for instance (0,0, 0,1, 1,0, NaN,NaN, 2,2, 2,3, 3,2) defines two disjoint triangles. Breaks may not occur at the start or end of the array, or adjacent to each other.

### CIRCLE

public static final Area.Type CIRCLE
Circle defined by central point and a radius (x, y, r).

### POINT

public static final Area.Type POINT
Point defined by two coordinates (x, y).

### MOC

public static final Area.Type MOC
Multi-Order Coverage map; each array element contains 64-bit NUNIQ bit pattern equivalenced to the double value.

### MULTISHAPE

public static final Area.Type MULTISHAPE
Collection of Area instances, to be considered as a union. Serialization is `[nshape, type0, ncoord0, type1, ncoord1, ..., coords]`. Type values are ordinals of the `Area.Type` enum.

See Also:
  - `serializeMultishape`
  - `deserializeMultishape`

## Method Details

### values

public static Area.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Returns:
  an array containing the constants of this enum type, in the order they are declared

### valueOf

public static Area.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

### isLegalArrayLength

public abstract boolean isLegalArrayLength(int n)
Indicates whether a given data array length can represent a shape of this type.

Parameters:
  `n` - length of candidate array
Returns:
  true iff this shape can be represented by a data array of the given length

### toMocUniqs

public abstract long[] toMocUniqs(double[] data, int level)
Returns an array of UNIQ values corresponding to this shape for a given maximum HEALPix level. Tiles may be returned at a higher level than requested, but the result should be at at least that resolution.

Parameters:
  `data` - data array containing shape details
  `level` - maximum HEALPix resolution level
Returns:
  array of MOC tile uniq values

### fromInt

public static Area.Type fromInt(int itype)
Retrieves an instance of this enum from its numeric code.

Parameters:
  `itype` - type ordinal
Returns:
  type instance