home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jsamples.z / SList5.java < prev    next >
Encoding:
Java Source  |  1997-07-30  |  712 b   |  30 lines

  1. // Copyright(c) 1996,1997 ObjectSpace, Inc.
  2.  
  3. import COM.objectspace.jgl.*;
  4.  
  5. /**
  6.  * Splicing a SList into another.
  7.  *
  8.  * @see COM.objectspace.jgl.SList
  9.  * @version 2.0.2
  10.  * @author ObjectSpace, Inc.
  11.  */
  12.  
  13. public class SList5
  14.   {
  15.   public static void main( String[] args )
  16.     {
  17.     SList list1 = new SList();
  18.     list1.add( "apple" );
  19.     list1.add( "banana" );
  20.     SList list2 = new SList();
  21.     list2.add( "lotus" );
  22.     list2.add( "ferrari" );
  23.     list2.add( "lamborghini" );
  24.     System.out.println( "before: list1 = " + list1 + ", list2 = " + list2 );
  25.  
  26.     list1.splice( list1.begin(), list2 );
  27.     System.out.println( "after: list1 = " + list1 + ", list2 = " + list2 );
  28.     }
  29.   }
  30.