home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / examples / SList5.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  679 b   |  30 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2.  
  3. import jgl.*;
  4.  
  5. /**
  6.  * Splicing a SList into another.
  7.  * <p>
  8.  * @see jgl.SList
  9.  * @version 1.1
  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.