< prev index next >

src/java.base/share/classes/java/util/LinkedHashMap.java

Print this page




 179      * errors due to ambiguous usages. So, we keep the name to
 180      * preserve unmodified compilability.
 181      *
 182      * The changes in node classes also require using two fields
 183      * (head, tail) rather than a pointer to a header node to maintain
 184      * the doubly-linked before/after list. This class also
 185      * previously used a different style of callback methods upon
 186      * access, insertion, and removal.
 187      */
 188 
 189     /**
 190      * HashMap.Node subclass for normal LinkedHashMap entries.
 191      */
 192     static class Entry<K,V> extends HashMap.Node<K,V> {
 193         Entry<K,V> before, after;
 194         Entry(int hash, K key, V value, Node<K,V> next) {
 195             super(hash, key, value, next);
 196         }
 197     }
 198 

 199     private static final long serialVersionUID = 3801124242820219131L;
 200 
 201     /**
 202      * The head (eldest) of the doubly linked list.
 203      */
 204     transient LinkedHashMap.Entry<K,V> head;
 205 
 206     /**
 207      * The tail (youngest) of the doubly linked list.
 208      */
 209     transient LinkedHashMap.Entry<K,V> tail;
 210 
 211     /**
 212      * The iteration ordering method for this linked hash map: {@code true}
 213      * for access-order, {@code false} for insertion-order.
 214      *
 215      * @serial
 216      */
 217     final boolean accessOrder;
 218 




 179      * errors due to ambiguous usages. So, we keep the name to
 180      * preserve unmodified compilability.
 181      *
 182      * The changes in node classes also require using two fields
 183      * (head, tail) rather than a pointer to a header node to maintain
 184      * the doubly-linked before/after list. This class also
 185      * previously used a different style of callback methods upon
 186      * access, insertion, and removal.
 187      */
 188 
 189     /**
 190      * HashMap.Node subclass for normal LinkedHashMap entries.
 191      */
 192     static class Entry<K,V> extends HashMap.Node<K,V> {
 193         Entry<K,V> before, after;
 194         Entry(int hash, K key, V value, Node<K,V> next) {
 195             super(hash, key, value, next);
 196         }
 197     }
 198 
 199     @java.io.Serial
 200     private static final long serialVersionUID = 3801124242820219131L;
 201 
 202     /**
 203      * The head (eldest) of the doubly linked list.
 204      */
 205     transient LinkedHashMap.Entry<K,V> head;
 206 
 207     /**
 208      * The tail (youngest) of the doubly linked list.
 209      */
 210     transient LinkedHashMap.Entry<K,V> tail;
 211 
 212     /**
 213      * The iteration ordering method for this linked hash map: {@code true}
 214      * for access-order, {@code false} for insertion-order.
 215      *
 216      * @serial
 217      */
 218     final boolean accessOrder;
 219 


< prev index next >