Mercurial > hg > Members > shoshi > TreeCMSv2
comparison src/treecms/tree/util/NodeChildrenImpl.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 |
---|---|
22 { | 22 { |
23 m_list = new ArrayList<T>(); | 23 m_list = new ArrayList<T>(); |
24 m_set = new HashSet<String>(); | 24 m_set = new HashSet<String>(); |
25 } | 25 } |
26 | 26 |
27 public NodeChildrenImpl(T... _args) | |
28 { | |
29 this(); | |
30 for(T i : _args){ | |
31 if(!add(i)){ | |
32 throw new IllegalArgumentException("duplicate Node UUID at "+i.getID().getUUID()); | |
33 } | |
34 } | |
35 } | |
36 | |
27 public NodeChildrenImpl(NodeChildren<T> _list) | 37 public NodeChildrenImpl(NodeChildren<T> _list) |
28 { | 38 { |
29 this(); | 39 this(); |
30 | 40 |
31 if(_list != null){ | 41 if(_list != null){ |
84 { | 94 { |
85 if(Collections.disjoint(m_set,_list.getUUIDSet())){ | 95 if(Collections.disjoint(m_set,_list.getUUIDSet())){ |
86 //共通要素がない | 96 //共通要素がない |
87 m_set.addAll(_list.getUUIDSet()); | 97 m_set.addAll(_list.getUUIDSet()); |
88 m_list.addAll(_list.getList()); | 98 m_list.addAll(_list.getList()); |
99 return true; | |
89 } | 100 } |
90 return false; | 101 return false; |
91 } | 102 } |
92 | 103 |
93 /** | 104 /** |
220 int result = 17; | 231 int result = 17; |
221 result = 37*result + m_list.hashCode(); | 232 result = 37*result + m_list.hashCode(); |
222 result = 37*result + m_set.hashCode(); | 233 result = 37*result + m_set.hashCode(); |
223 return result; | 234 return result; |
224 } | 235 } |
225 | |
226 public static NodeChildren<? extends Node<?>> hoge(Node<?> hoge) | |
227 { | |
228 return null; | |
229 } | |
230 } | 236 } |