1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.millscript.millscript.datatypes;
22
23 import java.io.Serializable;
24 import java.util.LinkedHashMap;
25 import java.util.Map;
26
27 /**
28 * This interface provides a version of the usual <code>LinkedHashMap</code>
29 * that includes a notion of a default which can be exploited by the MillScript
30 * index operator.
31 *
32 * @deprecated As of MillScript 10.2.0, this functionallity has been subsumed
33 * by the MillScript-Util project and it's Map API, see
34 * {@link org.millscript.commons.util.map.ELinkedHashMap}.
35 */
36 @Deprecated
37 public class LinkedHashMapWithDefault extends LinkedHashMap< Object, Object > implements MapWithDefault< Object, Object >, Serializable {
38
39 /**
40 * This is the ID from the release 10.0.0 for future compatibility.
41 */
42 private static final long serialVersionUID = 7594446941496718187L;
43
44 /**
45 * This linked hash map's default value.
46 */
47 private Object def = null;
48
49 /**
50 * @see org.millscript.millscript.datatypes.MapWithDefault#getDefault()
51 */
52 public Object getDefault() {
53 return def;
54 }
55
56 /**
57 * @see org.millscript.millscript.datatypes.MapWithDefault#setDefault(java.lang.Object)
58 */
59 public void setDefault( final Object d ) {
60 def = d;
61 }
62
63 /**
64 * Constructs a new linked hash map with default, using the default
65 * capacity and load factor.
66 */
67 public LinkedHashMapWithDefault() {
68 super();
69 }
70
71 /**
72 * Constructs a new linked hash map with default, using the specified
73 * capacity and default load factor.
74 *
75 * @param c the initial capacity
76 */
77 public LinkedHashMapWithDefault( final int c ) {
78 super( c );
79 }
80
81 /**
82 * Constructs a new linked hash map with default, using the specified
83 * capacity and load factor.
84 *
85 * @param c the initial capacity
86 * @param f the load factor
87 */
88 public LinkedHashMapWithDefault( final int c, final float f ) {
89 super( c, f );
90 }
91
92 /**
93 * Constructs a new linked hash map with default, which will have the same
94 * mappings as the specified map. The new linked hash map will use the
95 * default load factor and an initial capacity sufficient to hold all the
96 * mappings in the specified map.
97 *
98 * @param t the map to copy into this map
99 */
100 public LinkedHashMapWithDefault( final Map< ?, ? > t ) {
101 super( t );
102 }
103
104 }