@@ -0,0 +1,1775 @@
+package assignment5;%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class FileIndex %7B%0A    %0A    %09private File filePath;%0A    %0A%09private HashMap %3C String, ArrayList%3CInteger%3E %3E hash;%0A    %0A%09%0A%09private FileIndex(String path) throws Exception %7B%0A        %0A%09filePath = new File(path);%0A        %0A        hash = new HashMap %3CString, ArrayList%3CInteger%3E%3E();%0A        %0A%09%7D%0A    %0A%09private void indexTheFile() throws IOException, FileNotFoundException %7B%0A        %09int lineNumber = 1;%0A        %0A%09%09Scanner sc = new Scanner(filePath);%0A        %0A%09%09String line;%0A        %0A%09%09StringTokenizer token;%0A        %0A%09%09while(sc.hasNext()) %7B%0A            %09%09line = sc.nextLine();%0A            %09%09%0A            %09%09System.out.println(line);%0A%09%09%09%0A%09%09%09token = new StringTokenizer(line, %22 +=-,./?~:;~%60%5D%7D%5B%7B%7C%3E%3C_!@#$%25%5E&*(%5C%22')%5C%5C%22);%0A%09%09%09while(token.hasMoreTokens()) %7B%0A%09%09%09%09String str = token.nextToken().toLowerCase();%0A%09%09%09%09ArrayList%3CInteger%3E list = hash.get(str);%0A                if(list != null)%7B%0A%09%09%09%09%09list.add(lineNumber);%0A                %7D%0A%09%09%09%09else %7B%0A%09%09%09%09%09list = new ArrayList%3CInteger%3E();%0A%09%09%09%09%09list.add(lineNumber);%0A%09%09%09%09%09hash.put(str, list);%0A%09%09%09%09%7D%0A                %09%09%0A%09%09%09%7D%0A%09%09%09lineNumber++;%0A%09%09%7D%0A%09%7D%0A%09%0A%09private void displayResults() %7B%0A%09%09Set%3CString%3E set = hash.keySet();%0A%09%09Iterator iter = set.iterator();%0A%09%09while(iter.hasNext()) %7B%0A%09%09%09String key = (String)iter.next();%0A%09%09%09ArrayList%3CInteger%3E list = hash.get(key);%0A%09%09%09System.out.print(key + %22 :%5Ct%22);%0A            for(int i : list)%7B%0A%09%09%09%09System.out.print(i + %22 %22);%0A            %7D%0A%09%09%09System.out.println();%0A%09%09%7D%0A%09%7D%0A    %0A    public static void main(String args%5B%5D) %7B%0A        try %7B%0A        %0A            FileIndex file = new FileIndex(args%5B0%5D);%0A            file.indexTheFile();%0A            file.displayResults();%0A        %7D%0A        catch(Exception e) %7B%0A            System.out.println(e);%0A        %7D%0A    %7D%0A%7D%0A

Add solution for FileIndex (#5; Package)