home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Inprise / TRIAL / JBUILDER / JSAMPLES.Z / DList8.java < prev    next >
Text File  |  1998-05-08  |  737b  |  34 lines

  1. // Copyright(c) 1996,1997 ObjectSpace, Inc.
  2. import com.objectspace.jgl.*;
  3.  
  4. /**
  5.  * Splicing a DList into another.
  6.  *
  7.  * @see com.objectspace.jgl.DList
  8.  * @version 3.0.0
  9.  * @author ObjectSpace, Inc.
  10.  */
  11.  
  12. public class DList8
  13.   {
  14.   public static void main( String[] args )
  15.     {
  16.     DList dlist = new DList();
  17.     dlist.add( "apple" );
  18.     dlist.add( "banana" );
  19.     dlist.add( "lotus" );
  20.     dlist.add( "ferrari" );
  21.     dlist.add( "lamborghini" );
  22.     System.out.println( "dlist = " + dlist );
  23.  
  24.     try
  25.       {
  26.       dlist.splice( dlist.begin(), dlist, dlist.begin(), dlist.end() );
  27.       }
  28.     catch ( InvalidOperationException ioe )
  29.       {
  30.       System.out.println( "Caught: " + ioe );
  31.       }
  32.     }
  33.   }
  34.