javax.swing.text.html.parser
Class ContentModelState

java.lang.Object
  extended byjavax.swing.text.html.parser.ContentModelState

class ContentModelState
extends Object

A content model state. This is basically a list of pointers to the BNF expression representing the model (the ContentModel). Each element in a DTD has a content model which describes the elements that may occur inside, and the order in which they can occur.

Each time a token is reduced a new state is created.

See Annex H on page 556 of the SGML handbook for more information.

Author:
Arthur van Hoff
See Also:
Parser, DTD, Element, ContentModel

Field Summary
(package private)  ContentModel model
           
(package private)  ContentModelState next
           
(package private)  long value
           
 
Constructor Summary
  ContentModelState(ContentModel model)
          Create a content model state for a content model.
(package private) ContentModelState(Object content, ContentModelState next)
          Create a content model state for a content model given the remaining state that needs to be reduce.
(package private) ContentModelState(Object content, ContentModelState next, long value)
          Create a content model state for a content model given the remaining state that needs to be reduce.
 
Method Summary
 ContentModelState advance(Object token)
          Advance this state to a new state.
 Element first()
          Check if the state can be terminated.
 ContentModel getModel()
          Return the content model that is relevant to the current state.
 boolean terminate()
          Check if the state can be terminated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

ContentModel model

value

long value

next

ContentModelState next
Constructor Detail

ContentModelState

public ContentModelState(ContentModel model)
Create a content model state for a content model.


ContentModelState

ContentModelState(Object content,
                  ContentModelState next)
Create a content model state for a content model given the remaining state that needs to be reduce.


ContentModelState

ContentModelState(Object content,
                  ContentModelState next,
                  long value)
Create a content model state for a content model given the remaining state that needs to be reduce.

Method Detail

getModel

public ContentModel getModel()
Return the content model that is relevant to the current state.


terminate

public boolean terminate()
Check if the state can be terminated. That is there are no more tokens required in the input stream.

Returns:
true if the model can terminate without further input

first

public Element first()
Check if the state can be terminated. That is there are no more tokens required in the input stream.

Returns:
the only possible element that can occur next

advance

public ContentModelState advance(Object token)
Advance this state to a new state. An exception is thrown if the token is illegal at this point in the content model.

Returns:
next state after reducing a token