1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
/**************************************************************************/
/* */
/* The Why platform for program certification */
/* */
/* Copyright (C) 2002-2011 */
/* */
/* Jean-Christophe FILLIATRE, CNRS & Univ. Paris-sud 11 */
/* Claude MARCHE, INRIA & Univ. Paris-sud 11 */
/* Yannick MOY, Univ. Paris-sud 11 */
/* Romain BARDOU, Univ. Paris-sud 11 */
/* */
/* Secondary contributors: */
/* */
/* Thierry HUBERT, Univ. Paris-sud 11 (former Caduceus front-end) */
/* Nicolas ROUSSET, Univ. Paris-sud 11 (on Jessie & Krakatoa) */
/* Ali AYAD, CNRS & CEA Saclay (floating-point support) */
/* Sylvie BOLDO, INRIA (floating-point support) */
/* Jean-Francois COUCHOT, INRIA (sort encodings, hyps pruning) */
/* Mehdi DOGGUY, Univ. Paris-sud 11 (Why GUI) */
/* */
/* This software is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU Lesser General Public */
/* License version 2.1, with the special exception on linking */
/* described in file LICENSE. */
/* */
/* This software is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
/* */
/**************************************************************************/
import java.util.HashMap;
/*
- ajout du source dans le repertoire de l'API Java de krakatoa
cd .../lib/java_api
unzip src.zip java/util/HashMap.java
- resol pb syntaxe dans HashMap.java
commenté (avec //KML) 4 occurrences de
HashMap.this.expr ...
dans le code (pb support inner classes par Krakatoa)
de toute facon: le code des methodes de l'API n'est pas utilise par Krakatoa, seulement les spec
- HashMap etend AbstractMap: besoin de
unzip src.zip java/util/AbstractMap.java
- de nouveau 4 occurrences de
AbstractMap.this....
commentees avec //KML
- import explicite de java.util.Map.Entry dans AbstractMap: commenté
- AbstractMap implemente Map -> ajouter Map
unzip src.zip java/util/Map.java
- Map utilise Set et Collection ->
unzip src.zip java/util/Set.java
unzip src.zip java/util/Collection.java
- HashMap: champ transient Entry[] table; commente
- HashMap: methode getEntry commentee
- HashMap: methode removeEntryForKey commentee
- HashMap: methode removeMapping commentee
- ajout de Iterator
unzip src.zip java/util/Iterator.java
- methodes de serialization commentees
*/
class HashMapTest {
public static void main(String argv[]) {
HashMap m = new HashMap();
Integer zero = new Integer(0);
Integer one = new Integer(1);
m.put(zero,one);
Object o = m.get(zero);
//@ assert o instanceof Integer ;
// && o == 1;
// System.out.println("o = " + o);
}
}
|