Javaの最近のブログ記事

表記の通り以下のバージョンの Eclipse に Visual Editor をインストールしてみる。
Eclipse Ganymede
Version: 3.4.1
Build id: M20080911-1700

VisualEditor.jpg

Eclipse, Tomcat を動作させる。

○ eclipse 3.02 SDK 本体
http://www.eclipse.org/

○ tomcat プラグイン
sysdeo 3.0 Works with Eclipse 3.0 and Eclipse 2.1
http://www.sysdeo.com/eclipse/tomcatPlugin.html

○ Eclipse Modeling Framework(EMF)
http://www.eclipse.org/emf/

○ Graphical Editor Framework(GEF)
http://www.eclipse.org/gef/

○ Eclipse HTML Editor Plugin
Eclipse用のHTML/JSPエディタプラグインです。Eclipse 3.0以降でのみ動作。
http://amateras.sourceforge.jp/cgi-bin/fswiki/wiki.cgi?page=EclipseHTMLEditor 

当初、Eclipse HTML Editor Plugin だけでインストールしたら動作しなかった
EMF や GEF が必要ということがわかった。

HashMap の件

| コメント(0)

よくよく調べてみると配列の一つの要素に複数のエントリがあって、複数入る場合もあるようなのだ。ハッシュ値変換などでそうなるようなのだが今ひとつ良く理解していない(^^;

以下参照。

[1]= HashMap$Entry (id=28)
  hash= -820427199
  key= "key18" <------------------
    count= 5
    hash= 101943494
    offset= 0
    value= char[5] (id=54)
  next= HashMap$Entry (id=52)
    hash= 1493777409
    key= "key4" <------------------
    next= HashMap$Entry (id=56)
      hash= -819273471
      key= "key13" <------------------
      next= null
      value= "13"
      value= Integer (id=57)
  value= "18"

HashMap に難儀する

| コメント(0)

HashMap で以下の様にコーディングした。

HashMap map = new HashMap();
map.put("key1", new Integer(1));
map.put("key2", new Integer(2));
map.put("key3", new Integer(3));
map.put("key4", new Integer(4));
map.put("key5", new Integer(5));
map.put("key6", new Integer(6));
map.put("key7", new Integer(7));
map.put("key8", new Integer(8));
map.put("key9", new Integer(9));
map.put("key10", new String("10"));
map.put("key11", new String("11"));
map.put("key12", new String("12"));
map.put("key13", new String("13"));
map.put("key14", new String("14"));
map.put("key15", new String("15"));
map.put("key16", new String("16"));
map.put("key17", new String("17"));
map.put("key18", new String("18"));
map.put("key19", new String("19"));

当然 map の中には19個のオブジェクトが存在するはずだが、何故か15個しかない。Integerだけならおかしくないようだが、その後の String でキーが異なるにもかかわらず上書きされてしまうようなのだ。

以下エクリプスのデバッガで取得したもの。
ECLIPSE 2.1.3 / JDK 1.4.2.03

map= HashMap (id=21)
entrySet= HashMap$EntrySet (id=50)
keySet= null
loadFactor= 0.75
modCount= 19
size= 19
table= HashMap$Entry[32] (id=26)
[0]= null
[1]= HashMap$Entry (id=28)
[2]= HashMap$Entry (id=31)
[3]= null
[4]= null
[5]= null
[6]= null
[7]= null
[8]= null
[9]= HashMap$Entry (id=32)
[10]= HashMap$Entry (id=33)
[11]= null
[12]= null
[13]= HashMap$Entry (id=34)
[14]= HashMap$Entry (id=35)
[15]= HashMap$Entry (id=36)
[16]= HashMap$Entry (id=37)
[17]= null
[18]= null
[19]= null
[20]= HashMap$Entry (id=38)
[21]= null
[22]= null
[23]= HashMap$Entry (id=39)
[24]= HashMap$Entry (id=40)
[25]= null
[26]= HashMap$Entry (id=41)
[27]= HashMap$Entry (id=42)
[28]= null
[29]= HashMap$Entry (id=43)
[30]= HashMap$Entry (id=44)
[31]= null
threshold= 24
values= null

何が原因か全然わからない。
別のマシンで動作させるとちゃんと19個だったりするのでタチが悪い(^^;

ウェブページ

  • about
Powered by Movable Type 5.2.10

このアーカイブについて

このページには、過去に書かれたブログ記事のうちJavaカテゴリに属しているものが含まれています。

前のカテゴリはJapanese Chessです。

次のカテゴリはKendo Japanです。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。