|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CNodeManager
dasher.CAlphabetManager
public class CAlphabetManager
AlphabetManager is a specialisation of NodeManager which knows about an Alphabet.
The AlphabetManager is used by the DasherModel to perform tasks which require the knowledge of which Alphabet is currently in use. This includes the handling of output of text when the user enters or leaves a given node and extending the Model's tree of DasherNodes, either forwards or backwards, whenever necessary.
| Field Summary | |
|---|---|
protected int |
ContSymbol
|
protected int |
ConvertSymbol
|
protected CAlphabet |
m_Alphabet
Pointer to the current Alphabet, used to find out what a given character looks like typed (for the purposes of output) and displayed (if growing the DasherNode tree). |
protected java.util.ArrayList<java.lang.Integer> |
m_Colours
|
protected java.util.ArrayList<java.lang.String> |
m_DisplayText
|
protected CLanguageModel |
m_LanguageModel
Pointer to the LanguageModel used in determining the relative probability assigned to new Nodes. |
protected CDasherModel |
m_Model
Pointer to the DasherModel which performs some of the work in the course of producing probabilities. |
protected int |
SPSymbol
|
| Fields inherited from class dasher.CNodeManager |
|---|
m_iID |
| Constructor Summary | |
|---|---|
CAlphabetManager(CDasherModel Model,
CLanguageModel LanguageModel)
Sole constructor: produces an AlphabetManager linked to a given Model and LanguageModel. |
|
| Method Summary | |
|---|---|
void |
ClearNode(CDasherNode Node)
Stub; to be used if in future there is work to be done upon deleting a node. |
CDasherNode |
GetRoot(CDasherNode Parent,
long iLower,
long iUpper,
int UserData)
Creates a new root CDasherNode with the supplied parameters. |
void |
Output(CDasherNode Node,
java.util.ArrayList<CSymbolProb> Added,
int iNormalization)
Generates an EditEvent announcing a new character has been entered, inferring the character from the Node supplied. |
void |
PopulateChildren(CDasherNode Node)
Populates the children of a given DasherNode. |
void |
PopulateChildrenWithSymbol(CDasherNode Node,
int iExistingSymbol,
CDasherNode ExistingChild)
Populates the children of a given Node. |
void |
PopulateChildrenWithSymbol(CDasherNode Node,
int iExistingSymbol,
CDasherNode ExistingChild,
long[] cum)
Creates the children of a given Node given a set of probabilities associated with said children and, perhaps, one child which already exists. |
CDasherNode |
RebuildParent(CDasherNode Node,
int iGeneration)
Reconstructs the parent of a given node, in the case that it had been deleted but the user has now backed off far enough that we need to restore. |
void |
Ref()
Stub: AlphabetManager is not reference counted. |
void |
Undo(CDasherNode Node)
Generates an EditEvent announcing that the character represented by this Node should be removed. |
void |
Unref()
Stub: AlphabetManager is not reference counted. |
void |
WaitForChildren(CDasherNode node)
Suspends the current thread until a given Node's children have been created. |
| Methods inherited from class dasher.CNodeManager |
|---|
Enter, GetID, Leave |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CLanguageModel m_LanguageModel
protected CDasherModel m_Model
protected int SPSymbol
protected int ConvertSymbol
protected int ContSymbol
protected CAlphabet m_Alphabet
protected java.util.ArrayList<java.lang.Integer> m_Colours
protected java.util.ArrayList<java.lang.String> m_DisplayText
| Constructor Detail |
|---|
public CAlphabetManager(CDasherModel Model,
CLanguageModel LanguageModel)
Model - Linked DasherModelLanguageModel - Linked LanguageModel| Method Detail |
|---|
public CDasherNode GetRoot(CDasherNode Parent,
long iLower,
long iUpper,
int UserData)
GetRoot in class CNodeManagerParent - Parent to which the new root will be a childiLower - New node's lower probability bound with respect to its parentiUpper - New node's upper probability bound with respect to its parentUserData - Usage depends on the type of NodeManager
public void Ref()
Ref in class CNodeManagerpublic void Unref()
Unref in class CNodeManagerpublic void PopulateChildren(CDasherNode Node)
This is exactly the same as calling PopulateChildrenWithSymbol(Node, -2, null);
PopulateChildren in class CNodeManagerNode - Node to be given children.
public void PopulateChildrenWithSymbol(CDasherNode Node,
int iExistingSymbol,
CDasherNode ExistingChild)
Node - Node whose children we wish to populate.iExistingSymbol - Symbol of child node which already exists, if any; -2 if none.ExistingChild - Reference to the pre-existing child, if one exists.
public void PopulateChildrenWithSymbol(CDasherNode Node,
int iExistingSymbol,
CDasherNode ExistingChild,
long[] cum)
The probabilties supplied should not be cumulative, but should be normalised such that they add up to the value of LP_NORMALIZATION.
Node - Node whose children are to be populated.iExistingSymbol - Symbol of its existing child, or -2 if there is none.ExistingChild - Reference to its existing child, if any.cum - Probabilities to be associated with the children,
supplied in alphabet symbol order.public void ClearNode(CDasherNode Node)
Note that this method should NOT actually destroy the node, but should remove the Manager's references to it, if any exist.
ClearNode in class CNodeManagerNode - Node to be deleted
public void Output(CDasherNode Node,
java.util.ArrayList<CSymbolProb> Added,
int iNormalization)
The second and third parameters are solely for logging purposes. Logging is not currently enabled in JDasher and so these can safely be set to null and 0 respectively.
In the case that logging is enabled, passing the second parameter as null will cause this addition not to be logged.
Output in class CNodeManagerNode - The node whose symbol we wish to look up and announce.Added - An ArrayListiNormalization - The total to which probabilities should add (usually LP_NORMALIZATION) for the purposes of generating the logged probability.public void Undo(CDasherNode Node)
Undo in class CNodeManagerNode - Node whose symbol we wish to remove.
public CDasherNode RebuildParent(CDasherNode Node,
int iGeneration)
This will generate an EditContextEvent to try to extend its knowledge of the current context; this is necessary because Dasher only buffers a small amount of context internally. Typically a UI component is expected to reply with the appropriate context.
In the event that context is not available internally and the dispatched EditContextEvent is not passed a new context, the root symbol is created and returned.
RebuildParent in class CNodeManagerNode - The node whose parent we wish to recreated.iGeneration - The depth in the tree of this node.
public void WaitForChildren(CDasherNode node)
This simply polls the child-list every 50ms, and returns when it finds it is neither null nor empty.
node - Node whose children we wish to wait for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||