Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. import java.util.*;
  2. class Table implements Comparable{                            
  3.     private static int num;              
  4.     private ArrayList<Map<String,String>> list;        
  5.     public Table(){                      
  6.         list = new ArrayList<Map<String, String>>();
  7.         num = 0;
  8.     }
  9.     public void Add(Map<String, String> map){  
  10.         num++;
  11.         list.add(map);
  12.     }
  13.     public void Get(int k, String kvalue) throws Exception{
  14.         if(k >= num && k < 0)
  15.             throw new IndexOfBoundsExceptionl("Incorrect");/**Хочу вставить сюда исключение если такого елемента нет IndexOfBoundsException*/
  16.         Map<String, String> temp = list.get(k);
  17.         temp.get(kvalue);
  18.     }
  19.     public int compareTo(Object obj){
  20.         int j = 0;
  21.         List<Map<String, String>> t = (ArrayList)obj;
  22.         for(Map<String, String> m : t){
  23.         }
  24.         return 0;
  25.     }
  26.     public void SetSorted(){
  27.     }
  28. }
  29. public class task2 {
  30.  
  31.     /**
  32.      * @param args
  33.      */
  34.     public static void main(String[] args) {
  35.         // TODO Auto-generated method stub
  36.         try{
  37.         }
  38.         catch(IndexOfBoundsExceptionl ex){
  39.             System.out.println("Error of access to string\n");
  40.         }
  41.     }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement