I'm trying to move around nodes and append them either a 0 or a 1 depending on their position, as I'm doing a Huffman compression test.
However, when trying to use the method isLeaf()
which is from javax.swing.tree
.
Here's the segment of the code that's giving me issues.
private static void createTestMap(
final Node node,
final String string,
final Map<Character, String> map)
{
if(!node.isLeaf())
{
createTestMap(nodo.leftChild, string + "0", map);
createTestMap(nodo.rightChild, string + '1', map);
}
else
{
map.put(node.test, string);
}
}
With the node code on a different class. On this one it's giving me an error:
cannot find symbol - method isLeaf()
I'm extremely new to Java and coding in general so I'm not quite sure what's missing, as I've seen this method being used in several programs related to Huffman compression through nodes.