JavaÖÐHashMap£¬HashtableºÍLinkedList
½ñÌìÅöµ½Ò»¸öºÜÓÐÒâ˼µÄÎÊÌ⣬¾ÍÊǹØÓÚʹÓÃLinkedList×÷ΪHashMap»òÕßHashtableµÃkey£¬µ«ÊÇ×îºó·¢ÏÖÊý¾Ý²¢Ã»Óдæ½øÈ¥¡£
Ê×ÏÈ˵һÏÂHashMap£¬Hashtable°É£¬ËüÃǶ¼¼Ì³ÐÁËCloneable, Map, Serializable¡£ËüÃÇÁ½¸ö»ù±¾ÉÏÊÇÒ»ÑùµÄ£¬“The HashMap
class is roughly equivalent to Hashtable
, except that it is
unsynchronized and permits nulls.”¡£Çø±ð¾ÍÊÇHashMapÔÊÐí“ null
values and the null
key”£¬Í¬Ê± unsynchronized¡£ËüµÄÐÔÄÜÈ¡¾öÓÚ“ initial capacity
and load factor
”£¬¾ßÌå²Î¿¼¹Ù·½Îĵµ¡£HashMap»¹ÓÐÒ»¸öÌØÐÔ¾ÍÊDz»Äܱ£Ö¤´æÈëµÄÔªËصÄ˳Ðò£¬“HashMap does not guarantee that the order
will remain constant over time¡£” ¶ÔÓÚ´æÈëµ½ÀïÃæµÄkey£¬ÒªÇó“To successfully store and retrieve objects from a hashtable, the
objects used as keys must implement the hashCode
method and the equals
method. ”¡£¸ü¾ßÎҵIJâÊÔ£¬ÆäʵÕâ¸ö¶ÔÓÚHashMapÒ²ÊÇÊÊÓõġ£
Õâ¸ö¾ÍºÍÎÒ½ñÌìÅöµ½µÄÎÊÌâÁªÏµÉÏÁË£¬LinkedListÀàÀïÃæµÄhashCode()º¯ÊýÀ´Ô´ÓÚList.hashCode()£¬¾ßÌåÈçÏ£º
int hashCode = 1;
Iterator<E> i = list.iterator();
while (i.hasNext()) {
E obj = i.next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
}
Ò²¾ÍÊÇ˵hashCodeÒÀÀµÓÚÄÚ²¿´æ´¢µÄ¶ÔÏó£¬Ç¡ºÃÎÒ´æ´¢µÄÊÇÒ»¸ö³éÏóÀ࣬ÒÔ·½±ãʵÏÖ¶à̬ÐÔ£¬ËùÒÔ²¢Ã»ÓÐʵÏÖhashCodeº¯Êý¡£Èç¹û´æ´¢µÄÊÇÀàËÆStringµÄ»ù±¾Êý¾ÝÀàÐÍ»òÕßÊÇʵÏÖÁËhashCodeº¯ÊýµÄ¶ÔÏó¾Í¿ÉÒÔÁË¡£
×îºó»¹ÓÐÒ»¸öºÍHashMapÓеãÈÝÒ×»ìÏýµÄÀà¾ÍÊÇTreeMap¡£Ëü¼Ì³ÐÁË“Serializable, Cloneable, Map<K,V>, SortedMap<K,V>”£¬ÊÇSortedMap½Ó¿ÚÀàΨһµÄʵÏÖ¡£Ëü±¾ÖÊÉÏÊÇ“Red-Black tree”£¬ÀïÃæ´æ´¢µÄkeyÊÇÉýÐòÅÅÁеģ¬“ascending key order”¡£
²Î¿¼£º
http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Hashtable.html
http://java.sun.com/j2se/1.5.0/docs/api/java/util/LinkedList.html
http://java.sun.com/j2se/1.5.0/docs/api/java/util/TreeMap.html
http://java.sun.com/j2se/1.5.0/docs/api/java/util/SortedMap.html
Ïà¹ØÎĵµ£º
ͨ¹ý DAOFactory µÄ·ºÐÍд·¨À´ÑÝʾJava·ºÐ͵ÄÌØÊâÓ÷¨
СÐÍÏîÄ¿Öг£³£¶¼Ã»ÓÐÓÃÈý·½³Ö¾Ã»¯¿ò¼Ü£¬¶ø´ó¶¼ÊÇÓù«Ë¾»ò×ÔÐÐÒÀ¾ÝDAOģʽ·â×°µÄһЩ×é¼þÀ´Íê³ÉÊý¾Ý¿â³Ö¾Ã»¯¶¯×÷£¬²¢ÇÒ£¬Í¨³£ÎªÁ˸ü¾ß¿ÉÀ©Õ¹ÐÔ£¬³£³£Ê¹ÓóéÏ󹤳§Ä£Ê½À´½âñîºÏ¡£
Ò»¡¢ÏÈ¿´´úÂë
1¡¢¼òµ¥¹¤³§´úÂë
/************************************************* ......
¼¸ÌìÇ°£¬¸Õ¿´ÁËIBM DeveloperworksÉÏij¸ö¼¼Êõ´óÅ£×öµÄ¹ØÓÚÉè¼ÆREST·ç¸ñµÄJava MVC¿ª·¢¿ò¼ÜµÄÎÄÕ£¬½ñÌìÔÚGoogle CodeÉÏ·¢ÏÖÁËÒ»¸ö»ùÓÚJavaµÄREST·ç¸ñµÄMVC¿ª·¢¿ò¼Ü£¬È¡ÃûWebWind
¡£
“WebWindÊÇÒ»¸öJava MVC¿ò¼Ü¡£ºÍ³£¼ûµÄMVC¿ò¼ÜÈçStruts¡¢WebWork²»Í¬£¬WebWindÌìÉúÖ§³ÖÓû§ÓѺõÄURL£¬ÈÃWebÓ¦ÓóÌÐò¶ÔËÑË÷ÒýÇæ¸ü¼Ó ......
×î½üÔÚʹÓÃPowerDesignerÉè¼ÆÊý¾Ý¿â,Éè¼ÆÍêcdm ºÍ pdmʱ,Á˽⵽¿ÉÒÔÓÃoom×Ô¶¯Éú³ÉJavaÀà.
µ«ÊÇÉú³ÉµÄJavaÀàµÄĬÈϸñʽºÍ×Ô¼ºµÄÒªÇóÓÐÆ«²î,×îÖյõ½ÁËЩ½â¾ö°ì·¨.ÕâÀï¼Ç¼ÁËÏÂ.(ÎÒʹÓõİ汾ÊÇPowerDesigner12)
ÔÚoomÄ£ÐÍÖÐlanguage>edit current object language. ÀàµÄÖ÷¸ñʽÊÇ ......
1. ×ÜÌåÉè¼Æ
1.1 »ù±¾Éè¼Æ¸ÅÄîºÍ´¦ÀíÁ÷³Ì
1.1.1 ³ÌÐò»®·Ö
Ö÷Òª·ÖΪ·þÎñ¶ËºÍ¿Í»§¶ËÁ½¸ö²¿·Ö¡£
¿Í»§¶Ë²¿·ÖÓÖ·ÖΪͬ²½ÓëÒì²½Á½ÖÖģʽ¡£
1.1.2 ´¦ÀíÁ÷³ÌÃèÊö
JAVA°æ½Ó¿Úƽ̨Ö÷ҪʵÏÖÓëÍⲿ½Ó¿ÚµÄ·þÎñ¶ËºÍ¿Í»§¶ËµÄꬄ ......
Õâ¸öÊǼÓͼƬˮӡµÄ!
package com.pic;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.awt.image.*;
import org.w3c.dom.*;
import com.sun.image.codec.jpeg.*;
import javax.imageio.*;
public class ImgBean_i{
public void ImgBean_i(){
}
public void ImgYin(S ......