Application - package lab12; i import java.util.Scanner;...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab12; import java.util.Scanner; i public class Application { public static void main(String[] args) { p List aList = new List(); FileRead fr = new FileRead("bigOComboLock.txt"); String line = fr.readLine(); String [] tokens; S while(line!=null) { tokens = line.split(","); if(tokens.length==2) { aList.insert(new ComboLock(Integer.parseInt(tokens[0]), tokens[1])); } else if(tokens.length==3) { aList.insert(new DeletedComboLock(Integer.parseInt(tokens[0]), tokens[1], Integer.parseInt(tokens[2]))); } else if(tokens.length==5) { Name tempName = new Name(tokens[0], tokens[1], tokens[2]); ComboLock tempComboLock = new ComboLock(Integer.parseInt(tokens[3]), tokens[4]); aList.insert(new NameComboLock(tempComboLock, tempName.toString())); } else { aList.insert(new ComboLock()); System.out.println("Blank Oject at index "+aList.getIndex() +" because of wrong input data"); } line = fr.readLine(); } aList.selectionSort(); aList.display(); a Scanner console = new Scanner(System.in); System.out.println("ID"); int id = console.nextInt(); System.out.println("Combo"); String combo = console.next(); ComboLock anObj = new ComboLock(id, combo); System.out.println("Seq Serach");
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/10/2009 for the course CS 102 taught by Professor Kanipiakins during the Spring '09 term at University of Maryland Baltimore.

Page1 / 4

Application - package lab12; i import java.util.Scanner;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online