|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgdl.base.SizeListEntry
public class SizeListEntry
A special object that stores temporary elements during the calculation of node sizes in the NodeWeightCalculator: for every node, such a SizeListEntry is instantiated, holding all its direct tree children, the id, and the sum of its own weight and the sum of all its children in the tree.
Constructor Summary | |
---|---|
SizeListEntry(int id,
int ownSize)
Initialize the SizeListEntry Object with its id, and its won size |
Method Summary | |
---|---|
void |
addChild(int childId)
add a temporary child to the entry |
void |
addToSumOfWeight(int amount)
adds a value to the entries current sum of weight |
boolean |
checkIfContainsChild(int child)
|
java.util.LinkedList |
getChildren()
|
int |
getId()
|
int |
getSumOfWeight()
|
void |
removeChild(int child)
Removes a child from the list of node children, that are stored in the current sizeListEntry. |
java.lang.String |
toString()
returns a string representation of the listEntry, containing all children and the sum of weight. can be used for debug output |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SizeListEntry(int id, int ownSize)
id
- the address of the node in the allNodes list and the adjacence matrixownSize
- the current size of the singe node the entry is forMethod Detail |
---|
public void addChild(int childId)
childId
- the address of the child nodepublic java.util.LinkedList getChildren()
public int getSumOfWeight()
public void addToSumOfWeight(int amount)
amount
- the amout to add to the sum of weight of the entrypublic java.lang.String toString()
toString
in class java.lang.Object
public int getId()
public boolean checkIfContainsChild(int child)
child
- the address of child to check on whether it is contained in the entry.
public void removeChild(int child)
child
- the address of the child to remove from the entry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |