## com.saxonica.schema
Class DigitsFacet

    java.lang.Object
      com.saxonica.schema.Facet
          com.saxonica.schema.DigitsFacet

All Implemented Interfaces:
  java.io.Serializable

    public class DigitsFacet

extends Facet

Represents either of the facets totalDigits or fractionDigits

See Also:
  Serialized Form

Field Summary
`static int` `FRACTION_DIGITS` Constant identifying the fractionDigits facet
`static int` `TOTAL_DIGITS` Constant identifying the totalDigits facet

Fields inherited from class com.saxonica.schema.Facet
`ASSERT, ENUMERATION, FRACTIONDIGITS, LENGTH, MAX_EXCLUSIVE, MAX_INCLUSIVE, MAX_LENGTH, MIN_EXCLUSIVE, MIN_INCLUSIVE, MIN_LENGTH, PATTERN, TOTALDIGITS, WHITESPACE`

Constructor Summary
`DigitsFacet(int facetType)` Construct a totalDigits or fractionDigits facet.

Method Summary
`void` `checkFacetRestriction(UserSimpleType type, SimpleType base)` Check that this facet is legal when used on a type derived by restriction
`java.lang.String` `getName()` Get the name of this facet
`java.lang.String` `getValue()` Get the value of this facet as a string
`void` `setValue(java.lang.String value)` Set the value of this facet.
`boolean` `testAtomicValue(AtomicValue value)` Test whether an atomic value conforms to this facet

Methods inherited from class com.saxonica.schema.Facet
`getWhitespaceAction, isFacetName, isFixed, isNewlyIntroduced, makeFacet, serializeFacet, setFixed, testLength, testListValue, toLong`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TOTAL_DIGITS

    public static final int TOTAL_DIGITS

  Constant identifying the totalDigits facet

  See Also:
    Constant Field Values

### FRACTION_DIGITS

    public static final int FRACTION_DIGITS

  Constant identifying the fractionDigits facet

  See Also:
    Constant Field Values

Constructor Detail

### DigitsFacet

    public DigitsFacet(int facetType)

  Construct a totalDigits or fractionDigits facet. For internal use only.

  Parameters:
    `facetType` - indicates which facet to construct. One of `TOTAL_DIGITS` or `FRACTION_DIGITS`

Method Detail

### getName

    public java.lang.String getName()

  Get the name of this facet

  Specified by:
    `getName` in class `Facet`
  Returns:
    either "totalDigits" or "fractionDigits"

### getValue

    public java.lang.String getValue()

  Get the value of this facet as a string

  Specified by:
    `getValue` in class `Facet`
  Returns:
    the value of this facet as a string

### setValue

    public void setValue(java.lang.String value)
                  throws SchemaException

  Set the value of this facet. For internal use only.

  Specified by:
    `setValue` in class `Facet`
  Parameters:
    `value` - the value of the facet. This must be a string that parses as an integer.
  Throws:
    `SchemaException` - if the value is invalid (not an integer)

### checkFacetRestriction

    public void checkFacetRestriction(UserSimpleType type,
                                      SimpleType base)
                               throws SchemaException,
                                      ValidationException

  Check that this facet is legal when used on a type derived by restriction

  Overrides:
    `checkFacetRestriction` in class `Facet`
  Parameters:
    `base` - the type from which the restricted type is derived
    `type` - the type on which the facet is defined
  Throws:
    `SchemaException` - if the facet is not allowed for this simple type, or if the combination of facets is inconsistent with values defined on the base type.
    `ValidationException`

### testAtomicValue

    public boolean testAtomicValue(AtomicValue value)

  Test whether an atomic value conforms to this facet

  Overrides:
    `testAtomicValue` in class `Facet`
  Parameters:
    `value` - the value to be tested
  Returns:
    true if the value conforms; false if it doesn't conform

Copyright (c) Saxonica Limited. All rights reserved.