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

public final Class ContentModel

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
java.util.Vector, .Enumeration, java.io.*

A representation of a content model. A content model is basically a restricted BNF expression. It is restricted in the sense that it must be deterministic. This means that you don't have to represent it as a finite state automaton.

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

Author
Arthur van Hoff

Field Summary

Modifier and TypeField and Description
public Object
content

The content.

public ContentModel
next

The next content model (in a ',', '|' or '&' expression).

public int
type

Type.

private boolean[]
private boolean[]

Constructor Summary

AccessConstructor and Description
public
ContentModel()

Creates ContentModel

public
ContentModel(Element
the element
content
)

Create a content model for an element.

public
ContentModel(int
the type
type
,
ContentModel
the content
content
)

Create a content model of a particular type.

public
ContentModel(int
the type
type
,
Object
the content
content
,
ContentModel
the next content model
next
)

Create a content model of a particular type.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the content model could match an empty input stream
empty
()

Return true if the content model could match an empty input stream.

public boolean

Returns:

true if the token could potentially be the first token in the input stream
first
(Object
the token
token
)

Return true if the token could potentially be the first token in the input stream.

public Element

Returns:

the element that must be next
first
()

Return the element that must be next.

public void
getElements(Vector<Element>
the list of elements
elemVec
)

Update elemVec with the list of elements that are part of the this contentModel.

public String

Returns:

the string representation of this ContentModel
toString
()

Overrides java.lang.Object.toString.

Convert to a string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contentback to summary
public Object content

The content. Either an Element or a ContentModel.

nextback to summary
public ContentModel next

The next content model (in a ',', '|' or '&' expression).

typeback to summary
public int type

Type. Either '*', '?', '+', ',', '|', '&'.

valback to summary
private boolean[] val
valSetback to summary
private boolean[] valSet

Constructor Detail

ContentModelback to summary
public ContentModel()

Creates ContentModel

ContentModelback to summary
public ContentModel(Element content)

Create a content model for an element.

Parameters
content:Element

the element

ContentModelback to summary
public ContentModel(int type, ContentModel content)

Create a content model of a particular type.

Parameters
type:int

the type

content:ContentModel

the content

ContentModelback to summary
public ContentModel(int type, Object content, ContentModel next)

Create a content model of a particular type.

Parameters
type:int

the type

content:Object

the content

next:ContentModel

the next content model

Method Detail

emptyback to summary
public boolean empty()

Return true if the content model could match an empty input stream.

Returns:boolean

true if the content model could match an empty input stream

firstback to summary
public boolean first(Object token)

Return true if the token could potentially be the first token in the input stream.

Parameters
token:Object

the token

Returns:boolean

true if the token could potentially be the first token in the input stream

firstback to summary
public Element first()

Return the element that must be next.

Returns:Element

the element that must be next

getElementsback to summary
public void getElements(Vector<Element> elemVec)

Update elemVec with the list of elements that are part of the this contentModel.

Parameters
elemVec:Vector<Element>

the list of elements

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Convert to a string.

Returns:String

the string representation of this ContentModel