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

## ix.util.match
Class SimpleMatcher

    java.lang.Object
      ix.util.match.SimpleMatcher

    public final class SimpleMatcher

extends java.lang.Object

A simple pattern-matcher.

Field Summary
`static MatchEnv` | `emptyEnv` emptyEnv is used to return non-null without allocating an env.
`static Symbol` | `OPTIONAL`
`static Symbol` | `REST`

Constructor Summary
`SimpleMatcher()`

Method Summary
`static void` | `main(java.lang.String[] argv)`
`static MatchEnv` | `match(java.lang.Object pat, java.lang.Object dat)` Match tries to match a pattern against an object.
`static MatchEnv` | `match(java.lang.Object pat, java.lang.Object dat, MatchEnv env)`
`static MatchEnv` | `matchAnyPattern(java.util.List patterns, java.lang.Object data)`
`static MatchEnv` | `matchAnyValue(java.lang.Object pat, java.util.List dataValues)`
`static MatchEnv` | `mustMatch(java.lang.Object pat, java.lang.Object dat)`
`static MatchEnv` | `mustMatch(java.lang.Object pat, java.lang.Object dat, MatchEnv env)`

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

Field Detail

### emptyEnv

    public static final MatchEnv emptyEnv

  emptyEnv is used to return non-null without allocating an env.

### REST

    public static final Symbol REST

### OPTIONAL

    public static final Symbol OPTIONAL

Constructor Detail

### SimpleMatcher

    public SimpleMatcher()

Method Detail

### mustMatch

    public static final MatchEnv mustMatch(java.lang.Object pat,
                                           java.lang.Object dat)

### mustMatch

    public static final MatchEnv mustMatch(java.lang.Object pat,
                                           java.lang.Object dat,
                                           MatchEnv env)

### matchAnyPattern

    public static final MatchEnv matchAnyPattern(java.util.List patterns,
                                                 java.lang.Object data)

### matchAnyValue

    public static final MatchEnv matchAnyValue(java.lang.Object pat,
                                               java.util.List dataValues)

### match

    public static final MatchEnv match(java.lang.Object pat,
                                       java.lang.Object dat)

  Match tries to match a pattern against an object.

  Only ItemVars are treated as variables, and even then only if they appear in the pattern. Otherwise, they are treated as data. If a variable appears more than once in a pattern, the objects it matches must be equal.

  Numbers are compared using equal.

  Returns:
    a MatchEnv or null.
  See Also:
    `MatchEnv`, `ItemVar`

### match

    public static final MatchEnv match(java.lang.Object pat,
                                       java.lang.Object dat,
                                       MatchEnv env)

### main

    public static void main(java.lang.String[] argv)

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