|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CDasherNode
public class CDasherNode
A DasherNode represents a node in the DasherModel's tree; it is has a probability, children and one parent, and is typically drawn as a box with a letter or symbol in it.
It is capable of finding a Node at a given Screen location and of performing certain tree modifications (such as deleting its children) but otherwise mainly acts as a data structure.
| Field Summary | |
|---|---|
protected boolean |
m_bAlive
Indicates whether this node is currently drawable |
SGroupInfo |
m_BaseGroup
Root of the tree of groups into which this Node's children are arranged. |
protected boolean |
m_bHasAllChildren
Flag indicating whether all of this node's children are present |
protected boolean |
m_bSeen
Indicates whether this node's symbol has been output already |
boolean |
m_bShove
Whether this Node shoves or not (ie. |
protected EColorSchemes |
m_ColorScheme
Colour scheme associated with this node |
protected CContextBase |
m_Context
Language model context corresponding to this node's position in the tree. |
protected int |
m_iColour
Colour number if this node is using a colour scheme defined by an instance of CCustomColours |
protected long |
m_iHbnd
Upper cumulative probability bound relative to our parent |
protected long |
m_iLbnd
Lower cumulative probability bound relative to our parent |
protected int |
m_iPhase
Phase; this is related to colour cycling from one generation to the next. |
protected CLanguageModel |
m_LanguageModel
LanguageModel which was responsible for generating this node's probability |
protected java.util.ArrayList<CDasherNode> |
m_mChildren
List of this node's child Nodes |
CNodeManager |
m_NodeManager
NodeManager responsible for populating this Node's children. |
protected CDasherNode |
m_Parent
Parent Node |
java.lang.String |
m_strDisplayText
This Node's display text |
protected int |
m_Symbol
Symbol number represented by this node |
int |
m_UserData
Stores arbitrary information; may be extended to hold more in the future. |
| Constructor Summary | |
|---|---|
CDasherNode(CDasherNode Parent,
int Symbol,
int iphase,
EColorSchemes ColorScheme,
long ilbnd,
long ihbnd,
CLanguageModel lm,
int Colour)
Creates a Node and sets its describing variables. |
|
| Method Summary | |
|---|---|
boolean |
Alive()
Determines if this node is currently drawable. |
void |
Alive(boolean b)
Sets this node's Alive flag |
int |
ChildCount()
Returns the size of our child list. |
java.util.ArrayList<CDasherNode> |
Children()
Gets a reference to this Node's child list. |
EColorSchemes |
ColorScheme()
Gets this Node's colour scheme |
int |
Colour()
Gets this Node's colour index |
CContextBase |
Context()
Retrives the LM context associated with this node. |
void |
Delete_children()
Clears the Children list and sets our HasAllChildren flag to false; this will leave this section of tree unrefrenced and available for garbage collection. |
void |
DeleteNephews(CDasherNode pChild)
Deletes the nephews of a given child; that is to say, deletes its siblings' children. |
void |
DeleteNode()
At present, does nothing; Nodes will be "deleted" by virtue of their parents cutting them loose at the appropriate time, making them available for garbage collection. |
CDasherNode |
Get_node_under(long iNormalization,
long miY1,
long miY2,
long miMousex,
long miMousey)
Finds the node under a given mouse location, given our boundaries in Dasher space. |
java.util.ArrayList<CDasherNode> |
GetChildren()
Gets a reference to this Node's child list. |
double |
GetProb(int iNormalization)
Gets this node's probability |
boolean |
HasAllChildren()
Checks whether all of this Node's children exist at present |
long |
Hbnd()
Gets m_iHbnd |
boolean |
isSeen()
Gets this node's Seen flag |
void |
Kill()
Sets this node's Alive flag to false |
long |
Lbnd()
Gets m_iLbnd |
long |
MostProbableChild()
Gets the probability associated with this node's most probable child. |
boolean |
NodeIsParent(CDasherNode oldnode)
Determine if a given node is this one's parent. |
void |
OrphanChild(CDasherNode pChild)
Delete our children except for a given one, the delete ourself. |
CDasherNode |
Parent()
Gets this node's parent. |
int |
Phase()
Gets this node's colour-cycling phase |
long |
Range()
Gets the difference between m_iLbnd and m_iHbnd. |
void |
Seen(boolean seen)
Sets this node's Seen flag |
void |
SetChildren(java.util.ArrayList<CDasherNode> in)
Sets this Node's child list. |
void |
SetContext(CContextBase context)
Sets the context associated with this node. |
void |
SetHasAllChildren(boolean val)
Sets the HasAllChildren flag |
void |
SetParent(CDasherNode NewParent)
Attaches this Node to a given Parent. |
void |
SetRange(long iLower,
long iUpper)
Sets this node's probabilities. |
int |
Symbol()
Gets this node's symbol |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected EColorSchemes m_ColorScheme
protected int m_iPhase
protected int m_iColour
protected long m_iLbnd
protected long m_iHbnd
protected boolean m_bAlive
protected boolean m_bSeen
protected java.util.ArrayList<CDasherNode> m_mChildren
protected boolean m_bHasAllChildren
protected CDasherNode m_Parent
protected CLanguageModel m_LanguageModel
protected CContextBase m_Context
protected int m_Symbol
public SGroupInfo m_BaseGroup
public CNodeManager m_NodeManager
public int m_UserData
public java.lang.String m_strDisplayText
public boolean m_bShove
| Constructor Detail |
|---|
public CDasherNode(CDasherNode Parent,
int Symbol,
int iphase,
EColorSchemes ColorScheme,
long ilbnd,
long ihbnd,
CLanguageModel lm,
int Colour)
Parent - Parent NodeSymbol - Symbol numberiphase - Colour-cycling phaseColorScheme - Colour schemeilbnd - Lower bound of cum. probability relative to parentihbnd - Upper bound of cum. probability relative to parentlm - LanguageModelColour - Colour number| Method Detail |
|---|
public void DeleteNode()
public void SetContext(CContextBase context)
Releases its existing context with the language model if one exists.
context - New contextpublic long Lbnd()
public long Hbnd()
public long Range()
public java.util.ArrayList<CDasherNode> Children()
public java.util.ArrayList<CDasherNode> GetChildren()
public void SetChildren(java.util.ArrayList<CDasherNode> in)
in - The list of children to be attached to this node.public CContextBase Context()
public boolean NodeIsParent(CDasherNode oldnode)
oldnode - Potential parent
public int ChildCount()
public CDasherNode Parent()
public void SetParent(CDasherNode NewParent)
NewParent - Our new parent
public void SetRange(long iLower,
long iUpper)
iLower - New LbndiUpper - New Hbndpublic boolean Alive()
public void Alive(boolean b)
b - new valuepublic void Kill()
public boolean isSeen()
public void Seen(boolean seen)
seen - new valuepublic int Symbol()
public int Phase()
public EColorSchemes ColorScheme()
public int Colour()
public boolean HasAllChildren()
public void SetHasAllChildren(boolean val)
val - new valuepublic long MostProbableChild()
public CDasherNode Get_node_under(long iNormalization,
long miY1,
long miY2,
long miMousex,
long miMousey)
The "mouse position" may of course be replaced by any other point we want to find the node under.
iNormalization - Normalization value, usually LP_NORMALIZATIONmiY1 - Our upper bound in Dasher co-ordinate spacemiY2 - Our lower bound in Dasher co-ordiante spacemiMousex - Current mouse position XmiMousey - Current mouse position Y
public void OrphanChild(CDasherNode pChild)
pChild - Child to keeppublic void DeleteNephews(CDasherNode pChild)
pChild - Child whose children will NOT be deleted.public void Delete_children()
public double GetProb(int iNormalization)
iNormalization - Norm value, usually LP_NORMALIZATION
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||