RegExpPower (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.util

## Class RegExpPower

- java.lang.Object
- - hlt.language.util.RegExp
  - - hlt.language.util.RegExpOne
    - - hlt.language.util.RegExpPower

-     public class RegExpPower
      extends RegExpOne

  This class is a concrete implementation of the abstract class `RegExpOne` to represent a regular expression that is repeated a finite number of times.
  Version:
    Last modified on Tue Jun 19 17:38:08 2012 by hak
  Author:
    Hassan Aït-Kaci
  Copyright:
    © Hassan Aït-Kaci

- - ### Field Summary

    - ### Fields inherited from class hlt.language.util.RegExp

      `BINARY_EXP, CHOICE_EXP, CONCAT_EXP, EMPTY, EMPTY_EXP, OPTION_EXP, PLUS_EXP, POWER_EXP, RANGE_EXP, STAR_EXP, SYMBOL_EXP, UNARY_EXP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegExpPower(RegExp arg, int power)` Constructs a `RegExpPower` with the specified `RegExp` an `int`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RegExp` | `deepCopy()` This returns a deep copy of this `RegExp`.
    `boolean` | `equals(java.lang.Object other)` Returns `true` iff the specified object is a `RegExpPower` that has the same argument and power as this one.
    `int` | `getPower()`
    `RegExp` | `normalize()` This returns this `RegExpPower`'s normal form according to the following rewrite rules: `[PW:E]` `()^n` → `()` `[PW:0]` `X^n` → `()` (if `n≤0`) `[PW:1]` `X^1` → `X` `[PW:O]` `X?^n` → `X_0^n` `[PW:P]` `X+^n` → `X_n~` `[PW:S]` `X\*^n` → `X\*` `[PW:N]` `X^m^n` → `X^m×n` `[PW:R]` `X_m^n^p` → `X_m×p^n×p`
    `RegExpPower` | `setPower(int power)`
    `RegExp` | `shallowCopy()` This returns a shallow copy of this `RegExp`.
    `java.lang.String` | `toString()` Returns a printable form for this `RegExpPower`.
    `int` | `type()` This returns the specific type identifying this `RegExp`.

    - ### Methods inherited from class hlt.language.util.RegExpOne

      `getArg, normalArg`

    - ### Methods inherited from class hlt.language.util.RegExp

      `cleanup, isBinary, isChoice, isConcat, isEmpty, isLexLess, isOption, isPlus, isPower, isRange, isStar, isSymbol, isUnary, normEquals, noTrace, tag, toggleTrace, toNormalString, trace, tracing`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### RegExpPower

          public RegExpPower(RegExp arg,
                     int power)

      Constructs a `RegExpPower` with the specified `RegExp` an `int`.

  - ### Method Detail

    - #### getPower

          public final int getPower()

    - #### shallowCopy

          public final RegExp shallowCopy()

      Description copied from class: `RegExp`
      This returns a shallow copy of this `RegExp`.
      Specified by:
        `shallowCopy` in class `RegExp`

    - #### deepCopy

          public final RegExp deepCopy()

      Description copied from class: `RegExp`
      This returns a deep copy of this `RegExp`.
      Specified by:
        `deepCopy` in class `RegExp`

    - #### type

          public final int type()

      Description copied from class: `RegExp`
      This returns the specific type identifying this `RegExp`.
      Specified by:
        `type` in class `RegExp`

    - #### setPower

          public final RegExpPower setPower(int power)

    - #### normalize

          public RegExp normalize()

      This returns this `RegExpPower`'s normal form according to the following rewrite rules:
      1. `[PW:E]` `()^n` → `()`
      2. `[PW:0]` `X^n` → `()` (if `n≤0`)
      3. `[PW:1]` `X^1` → `X`
      4. `[PW:O]` `X?^n` → `X_0^n`
      5. `[PW:P]` `X+^n` → `X_n~`
      6. `[PW:S]` `X\*^n` → `X\*`
      7. `[PW:N]` `X^m^n` → `X^m×n`
      8. `[PW:R]` `X_m^n^p` → `X_m×p^n×p`
      Specified by:
        `normalize` in class `RegExp`

    - #### equals

          public final boolean equals(java.lang.Object other)

      Returns `true` iff the specified object is a `RegExpPower` that has the same argument and power as this one.
      Overrides:
        `equals` in class `RegExpOne`

    - #### toString

          public final java.lang.String toString()

      Returns a printable form for this `RegExpPower`.
      Overrides:
        `toString` in class `java.lang.Object`