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

## com.saxonica.fsa
Class Edge

    java.lang.Object
      com.saxonica.fsa.Edge

    public class Edge

extends Object

Internal class to represent the data associated with a transition: the element that triggers the transition, and the new state that results from the transition.

Constructor Summary
`Edge()`

Method Summary
`AutomatonState` | `getTargetState()` Get the state resulting from this transition
`Term` | `getTerm()` Get the element or wildcard particle causing this transition
`String` | `matches(Edge de, SchemaCompiler compiler)` Test whether edges in two different finite state machines match each other.
`void` | `setTargetState(AutomatonState targetState)` Set the state resulting from this transition
`void` | `setTerm(Term term)` Set the element or wildcard particle causing this transition

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

Constructor Detail

### Edge

    public Edge()

Method Detail

### setTargetState

    public void setTargetState(AutomatonState targetState)

  Set the state resulting from this transition

  Parameters:
    `targetState` - the state at the end of this edge

### getTargetState

    public AutomatonState getTargetState()

  Get the state resulting from this transition

  Returns:
    the state at the end of this edge

### setTerm

    public void setTerm(Term term)

  Set the element or wildcard particle causing this transition

  Parameters:
    `term` - the term that causes this transition

### getTerm

    public Term getTerm()

  Get the element or wildcard particle causing this transition

  Returns:
    the term that causes this transition

### matches

    public String matches(Edge de,
                          SchemaCompiler compiler)

  Test whether edges in two different finite state machines match each other. This is called while establishing whether one type subsumes another.

  From Thompson & Tobin 2003: an edge BE matches another edge DE iff one of the following three conditions holds: (1) they are labelled as element declarations with the same expanded name; (2) BE is labelled with a wildcard and DE is labelled with an element declaration in a namespace allowed by the wildcard; (3) BE and DE are both wildcards and DE's label is an intensional subset of BE's. In case (3) we add the rule, not in Thompson and Tobin, that the processContents of DE must be at least as strong as the processContents of BE.

  It is also necessary that the types of B and D are compatible, and that their nillability is compatible, and that their value constraints are compatible, and that the disallowed substitutions of D is a superset of those of B.

  Returns:
    null if the edges match, or a string explaining the reason for the non-match if not.

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

Copyright (C) Michael H. Kay. All rights reserved.