KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > innig > macker > example > conventions > AlphaTree


1 package net.innig.macker.example.conventions;
2
3 import java.util.*;
4 import java.io.*;
5
6 public final class AlphaTree
7     extends StringTree
8     {
9     public AlphaTree(AlphaTree parent, String JavaDoc word)
10         { super(parent, word); }
11     
12     protected Set/*<String>*/ getChildSuffixes()
13         {
14         if(lettersAsStrings == null)
15             {
16             lettersAsStrings = new TreeSet();
17             for(char c = 'a'; c <= 'z'; c++)
18                 lettersAsStrings.add(String.valueOf(c));
19             }
20         return lettersAsStrings;
21         }
22     
23     protected StringTree makeChild(String JavaDoc childWord)
24         { return new AlphaTree(this, childWord); }
25     
26     private static Set lettersAsStrings;
27     }
Popular Tags