class TribeInfo { String name; int fierceness; String planet; public TribeInfo (String name, int fierceness, String planet) { this.name = name; this.fierceness = fierceness; this.planet = planet; } } //end-TribeInfo public class BinaryTreeMapExample3 { public static void main (String[] argv) { // Create an instance. BinaryTreeMap3 tree = new BinaryTreeMap3 (); // Put some key-value pairs inside. TribeInfo info = new TribeInfo ("Ewok", 3, "Endor"); tree.add ( new KeyValuePair (info.name, info) ); info = new TribeInfo ("Aqualish", 6, "Ando"); tree.add ( new KeyValuePair (info.name, info) ); info = new TribeInfo ("Gungan", 2, "Naboo"); tree.add ( new KeyValuePair (info.name, info) ); info = new TribeInfo ("Amanin", 8, "Maridun"); tree.add ( new KeyValuePair (info.name, info) ); info = new TribeInfo ("Jawa", 6, "Tatooine"); tree.add ( new KeyValuePair (info.name, info) ); info = new TribeInfo ("Hutt", 7, "Varl"); tree.add ( new KeyValuePair (info.name, info) ); info = new TribeInfo ("Cerean", 4, "Cerea"); tree.add ( new KeyValuePair (info.name, info) ); // Get all the key-value pairs: KeyValuePair[] tribes = tree.getAllKeyValuePairs (); // Print. for (int i=0; i < tribes.length; i++) { System.out.println (tribes[i]); } } }