Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Table implements Comparable{
- private static int num;
- private ArrayList<Map<String,String>> list;
- public Table(){
- list = new ArrayList<Map<String, String>>();
- num = 0;
- }
- public void Add(Map<String, String> map){
- num++;
- list.add(map);
- }
- public void Get(int k, String kvalue) throws Exception{
- if(k >= num && k < 0)
- throw new IndexOfBoundsExceptionl("Incorrect");/**Хочу вставить сюда исключение если такого елемента нет IndexOfBoundsException*/
- Map<String, String> temp = list.get(k);
- temp.get(kvalue);
- }
- public int compareTo(Object obj){
- int j = 0;
- List<Map<String, String>> t = (ArrayList)obj;
- for(Map<String, String> m : t){
- }
- return 0;
- }
- public void SetSorted(){
- }
- }
- public class task2 {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- try{
- }
- catch(IndexOfBoundsExceptionl ex){
- System.out.println("Error of access to string\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement