home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
SList3.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
829b
|
36 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import COM.objectspace.jgl.*;
/**
* Insertion.
*
* @see COM.objectspace.jgl.SList
* @version 2.0.2
* @author ObjectSpace, Inc.
*/
public class SList3
{
public static void main( String[] args )
{
SList list = new SList();
list.add( "bat" );
list.add( "cat" );
list.add( "dog" );
System.out.println( "list = " + list );
System.out.println();
list.insert( list.begin(), "ape" );
System.out.println( "After insert at begin = " + list );
list.insert( list.end(), "emu" );
System.out.println( "After insert at end = " + list );
SListIterator i = list.begin();
i.advance( 3 );
list.insert( i, 2, "fox" );
System.out.println( "After list.insert( i, 2, fox ) = " + list );
}
}