APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.text.html.parser

pack-priv Class ContentModelState

extends Object
Class Inheritance

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

Modifier and TypeField and Description
pack-priv ContentModel
pack-priv ContentModelState
pack-priv long

Constructor Summary

AccessConstructor and Description
public
ContentModelState(ContentModel model)

Create a content model state for a content model.

pack-priv
ContentModelState(Object content, ContentModelState next)

Create a content model state for a content model given the remaining state that needs to be reduce.

pack-priv
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

Modifier and TypeMethod and Description
public ContentModelState

Returns:

next state after reducing a token
advance
(Object token)

Advance this state to a new state.

public Element

Returns:

the only possible element that can occur next
first
()

Check if the state can be terminated.

public ContentModel
getModel()

Return the content model that is relevant to the current state.

public boolean

Returns:

true if the model can terminate without further input
terminate
()

Check if the state can be terminated.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

modelback to summary
pack-priv ContentModel model
nextback to summary
pack-priv ContentModelState next
valueback to summary
pack-priv long value

Constructor Detail

ContentModelStateback to summary
public ContentModelState(ContentModel model)

Create a content model state for a content model.

ContentModelStateback to summary
pack-priv ContentModelState(Object content, ContentModelState next)

Create a content model state for a content model given the remaining state that needs to be reduce.

ContentModelStateback to summary
pack-priv 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

advanceback to summary
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:ContentModelState

next state after reducing a token

firstback to summary
public Element first()

Check if the state can be terminated. That is there are no more tokens required in the input stream.

Returns:Element

the only possible element that can occur next

getModelback to summary
public ContentModel getModel()

Return the content model that is relevant to the current state.

terminateback to summary
public boolean terminate()

Check if the state can be terminated. That is there are no more tokens required in the input stream.

Returns:boolean

true if the model can terminate without further input

Annotations
@SuppressWarnings:fallthrough