# Class AsciiMocCoverage

java.lang.Object
uk.ac.starlink.ttools.cone.MocCoverage
uk.ac.starlink.ttools.cone.AsciiMocCoverage

All Implemented Interfaces:
  `Coverage`

public class AsciiMocCoverage extends MocCoverage
MOC coverage implementation which uses the ASCII serialization.

Since:
  29 Nov 2023
Author:
  Mark Taylor
See Also:
  - MOC v2.0 sec 4.2.3

## Nested Class Summary

### Nested classes/interfaces inherited from interface Coverage

`Coverage.Amount`

## Field Summary

### Fields inherited from class MocCoverage

`DFLT_HPI`

## Constructor Summary

Constructors
Constructor
Description
`AsciiMocCoverage(String asciiMoc)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected cds.moc.SMoc`
`createMoc()`
Constructs the MOC which will define this object's coverage.
`static boolean`
`looksLikeAsciiMoc(String txt)`
Test whether a string is apparently a (spatial) ASCII MOC as described in sec 4.3.2 of MOC 2.0.

### Methods inherited from class MocCoverage

`discOverlaps, getAmount, getMoc, initCoverage`

### Methods inherited from class Object

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

## Constructor Details

### AsciiMocCoverage

public AsciiMocCoverage(String asciiMoc)
Constructor.

Parameters:
  `asciiMoc` - MOC encoded using the ASCII MOC serialization

## Method Details

### createMoc

protected cds.moc.SMoc createMoc() throws IOException
Description copied from class: `MocCoverage`
Constructs the MOC which will define this object's coverage. This method, which may be time-consuming, will be called a maximum of once by the `MocCoverage.initCoverage()` method of `MocCoverage`, and should not be called by anyone else.

Specified by:
  `createMoc` in class `MocCoverage`
Returns:
  new MOC defining footprint, or null
Throws:
  `IOException`

### looksLikeAsciiMoc

public static boolean looksLikeAsciiMoc(String txt)
Test whether a string is apparently a (spatial) ASCII MOC as described in sec 4.3.2 of MOC 2.0.

Parameters:
  `txt` - string to test
Returns:
  true if text looks like it could be a spatial MOC
See Also:
  - MOC 2.0 sec 4.3.2