public class BasicScene extends Object implements Scene
BasicScene uses the Java collections classes to implement the scene infrastructure in an obvious and unoptimized way. Future implementations of the scene interface may
Constructor and Description |
---|
BasicScene() |
Modifier and Type | Method and Description |
---|---|
void |
_markDescendents(SceneElement elt,
short mark,
boolean makeChoices)
Mark the given element and all of its descendents
with the given mark, so that a subsequent traversal
will be able to distinguish between elements inside
and outside of the marked set.
|
boolean |
_sameID(BitSet id1,
BitSet id2)
Return true if the supports of the two elements (i.e.
|
CompositeElement |
addComposite(TypedData data,
double confidence,
SceneElement[] children,
String[] names)
Add a new composite element to the database and return
it.
|
StrokeElement |
addStroke(TimedStroke stroke)
Add a new stroke element to the database.
|
List |
choices()
Return a list of all of the choices contained in the scene.
|
void |
confirm(CompositeElement elt,
boolean makeChoices)
Accept the given interpretation of the set of strokes that the
given element covers as the correct interpretation of
those strokes.
|
List |
elementsOfType(Type type,
CompositeElement elt)
Find the elements in the scene with the given type that do not
contradict the given element, and return them as a list.
|
int |
getCompositeCount()
Return a count of the total number of composite
nodes in the database, for a crude measure of
performance.
|
int |
getStrokeCount()
Return a count of the total number of stroke
nodes in the database, for a crude measure of
performance.
|
boolean |
isConsistent(SceneElement e1,
SceneElement e2)
Return whether or not the two elements are consistent, that is,
whether the leaf nodes that they cover (their support) are
strictly disjoint.
|
boolean |
isCoveringAll(SceneElement elt)
Return whether or not this element covers all of the leaves.
|
void |
removeElement(SceneElement elt)
Remove an element from the database.
|
List |
roots()
Return a list of every root node in the database, i.e.
|
boolean |
sameSupport(SceneElement e1,
SceneElement e2)
Return true if the supports of the two elements (i.e.
|
List |
strokes()
Return a list the stroke elements of the scene in
the order that they were added to the database.
|
public CompositeElement addComposite(TypedData data, double confidence, SceneElement[] children, String[] names)
addComposite
in interface Scene
data
- The typed data associated with the composite.confidence
- The confidence of recognition, between 0 and 1.children
- The children of this element in the tree.names
- The names of the children.public List choices()
public StrokeElement addStroke(TimedStroke stroke)
public void confirm(CompositeElement elt, boolean makeChoices)
public List elementsOfType(Type type, CompositeElement elt)
elementsOfType
in interface Scene
type
- The type of elements that will be returned.elt
- The element that the returned set must be consistent with,
or null if it doesn't matter.isConsistent(SceneElement, SceneElement)
public int getCompositeCount()
public int getStrokeCount()
public boolean isCoveringAll(SceneElement elt)
isCoveringAll
in interface Scene
public boolean isConsistent(SceneElement e1, SceneElement e2)
isConsistent
in interface Scene
public void removeElement(SceneElement elt)
removeElement
in interface Scene
public List roots()
public boolean sameSupport(SceneElement e1, SceneElement e2)
public List strokes()
public void _markDescendents(SceneElement elt, short mark, boolean makeChoices)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.