Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jchrest.lib
Class NumberPattern

    java.lang.Object
      jchrest.lib.Pattern
          jchrest.lib.PrimitivePattern
              jchrest.lib.NumberPattern

    public class NumberPattern

extends PrimitivePattern

The NumberPattern is a type of PrimitivePattern used to hold numbers. The number is treated as a single object. Instances of this class are immutable.

Method Summary
`static NumberPattern` | `create(int num)` Static creator method attempts to retrieve a cached instance for given number, else creates and returns a new NumberPattern instance.
`boolean` | `equalPrimitive(PrimitivePattern pattern)` Two NumberPatterns are only equal if their stored numbers are the same.
`int` | `getNumber()` Accessor method for the stored number.
`boolean` | `matches(Pattern pattern)` Two NumberPatterns only match if their stored numbers are the same.
`java.lang.String` | `toString()` Return a string representation of this pattern.

Methods inherited from class jchrest.lib.Pattern
`makeActionList, makeNumber, makeString, makeVerbalList, makeVerbalList, makeVisualList, makeVisualList`

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

Method Detail

### create

    public static NumberPattern create(int num)

  Static creator method attempts to retrieve a cached instance for given number, else creates and returns a new NumberPattern instance.

### getNumber

    public int getNumber()

  Accessor method for the stored number.

### equalPrimitive

    public boolean equalPrimitive(PrimitivePattern pattern)

  Two NumberPatterns are only equal if their stored numbers are the same.

  Specified by:
    `equalPrimitive` in class `PrimitivePattern`

### matches

    public boolean matches(Pattern pattern)

  Two NumberPatterns only match if their stored numbers are the same.

  Specified by:
    `matches` in class `Pattern`

### toString

    public java.lang.String toString()

  Return a string representation of this pattern.

  Specified by:
    `toString` in class `Pattern`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD