Mercurial > hg > Members > shoshi > TreeCMSv2
comparison src/treecms/tree/util/NodeAttributesImpl.java @ 17:168deb591f21
commit
author | shoshi |
---|---|
date | Tue, 24 May 2011 00:33:12 +0900 |
parents | bb9760760744 |
children | 084de6909451 |
comparison
equal
deleted
inserted
replaced
16:bb9760760744 | 17:168deb591f21 |
---|---|
15 public NodeAttributesImpl() | 15 public NodeAttributesImpl() |
16 { | 16 { |
17 m_attrs = new HashMap<ByteBuffer,ByteBuffer>(); | 17 m_attrs = new HashMap<ByteBuffer,ByteBuffer>(); |
18 } | 18 } |
19 | 19 |
20 public NodeAttributesImpl(Map<ByteBuffer,ByteBuffer> _map) | |
21 { | |
22 this(); | |
23 m_attrs.putAll(_map); | |
24 } | |
25 | |
20 public NodeAttributesImpl(NodeAttributesImpl _attrs) | 26 public NodeAttributesImpl(NodeAttributesImpl _attrs) |
21 { | 27 { |
22 super(); | 28 this(); |
23 m_attrs.putAll(_attrs.m_attrs); | 29 m_attrs.putAll(_attrs.m_attrs); |
24 } | 30 } |
25 | 31 |
26 @Override | 32 @Override |
27 public Set<ByteBuffer> getKeySet() | 33 public Set<ByteBuffer> getKeySet() |
76 @Override | 82 @Override |
77 public void clearAttributes() | 83 public void clearAttributes() |
78 { | 84 { |
79 m_attrs.clear(); | 85 m_attrs.clear(); |
80 } | 86 } |
81 | 87 |
88 @Override | |
89 public boolean equals(Object _o) | |
90 { | |
91 if(_o instanceof NodeAttributes || _o == null){ | |
92 return false; | |
93 } | |
94 | |
95 NodeAttributes attr = (NodeAttributes)_o; | |
96 Map<ByteBuffer,ByteBuffer> map = attr.asMap(); | |
97 return m_attrs.equals(map); | |
98 } | |
99 | |
100 @Override | |
101 public int hashCode() | |
102 { | |
103 return m_attrs.hashCode(); | |
104 } | |
82 } | 105 } |