Package cug.ptree

Interface Summary
PTreeOwner interface for an object that owns 1 or more PTrees; (pluggability)
 

Class Summary
PersonTable  
PTree Tree to store Person objects typical representation of organization (left to right this time): O.OU.OU.person etc.
PTreeAttRec  
PTreeAtts  
PTreeAttsTable  
PTreeBuilder builder for ptree incl. jdbc based persistence layer
PTreeMemberRec  
PTreeMemberTable  
PTreeOwnerImpl null implementation of PTreeOwner
PTreeTable  
RStones  
TestPTree static String fn = "PTreeTest.txt"; public static void main( String[] args ) { if ( args.length > 0 ) fn = args[0]; try { RStones rs = new RStones(); rs.build(); PrintWriter pw = new PrintWriter( new FileOutputStream( fn ) ); PTree.report( pw, rs ); pw.close(); String s = "not mick jagger"; PTree pt = rs.getNode( s ); Iterator it = pt.getPersonsBelowIt(); while ( it.hasNext() ) { Person p = (Person)it.next(); System.err.println( p.toString() ); } } catch ( Exception ex ) { ex.printStackTrace(); System.exit( 1 ); } } } class RStones extends PTree { IDFactory idf = new IDFactory(); RStones() { super( "rolling stones" ); } public void build() throws Exception { String idTemplate = "rs_1"; Person m = new Person( new Name_NL( "Mick Jagger" ) ); m.setPersonID( idf.createUniqueID( idTemplate ) ); Person k = new Person( new Name_NL( "Keith Richards" ) ); k.setPersonID( idf.createUniqueID( idTemplate ) ); Person b = new Person( new Name_NL( "Brian Jones" ) ); b.setPersonID( idf.createUniqueID( idTemplate ) ); Person c = new Person( new Name_NL( "Charlie Watts" ) ); c.setPersonID( idf.createUniqueID( idTemplate ) ); Person w = new Person( new Name_NL( "Bill Wyman" ) ); w.setPersonID( idf.createUniqueID( idTemplate ) ); PTree pt = createNode( "singers" ); pt.addPerson( m ); pt.addPerson( b ); addNode( pt ); pt = createNode( "rhythm" ); pt.addPerson( c ); pt.addPerson( w ); addNode( pt ); PTree branch = createNode( "not mick jagger" ); pt = branch.createNode( "string" ); pt.addPerson( k ); pt.addPerson( b ); pt.addPerson( w ); branch.addNode( pt ); pt = branch.createNode( "older" ); pt.addPerson( b ); pt.addPerson( c ); branch.addNode( pt ); addNode( branch ); } }