| 206 | } |
| 207 | |
| 208 | private void init(Hashtable toCopy) { |
| 209 | super.copy(toCopy); |
| 210 | Hashtable f = (Hashtable) toCopy.get("from"); |
| 211 | if (f != null) { |
| 212 | from.copy(f); |
| 213 | } |
| 214 | iconUrl = (String) toCopy.get("icon"); |
| 215 | pictureUrl = (String) toCopy.get("picture"); |
| 216 | sourceUrl = (String) toCopy.get("source"); |
| 217 | String heightStr = (String) toCopy.get("height"); |
| 218 | if (heightStr != null) { |
| 219 | height = Integer.parseInt(heightStr); |
| 220 | } |
| 221 | String widthStr = (String) toCopy.get("width"); |
| 222 | if (widthStr != null) { |
| 223 | width = Integer.parseInt(widthStr); |
| 224 | } |
| 225 | link = (String) toCopy.get("link"); |
| 226 | created_time = (String) toCopy.get("created_time"); |
| 227 | updated_time = (String) toCopy.get("updated_time"); |
| 228 | String positionStr = (String) toCopy.get("position"); |
| 229 | if (positionStr != null) { |
| 230 | position = Integer.parseInt(positionStr); |
| 231 | } |
| 232 | |
| 233 | images = (Vector) toCopy.get("images"); |
| 234 | |
| 235 | Hashtable data = (Hashtable) toCopy.get("comments"); |
| 236 | if (data != null) { |
| 237 | comments = new Vector(); |
| 238 | Vector commentsArray = (Vector) data.get("data"); |
| 239 | for (int i = 0; i < commentsArray.size(); i++) { |
| 240 | Hashtable comment = (Hashtable) commentsArray.elementAt(i); |
| 241 | Post p = new Post(); |
| 242 | p.copy(comment); |
| 243 | comments.addElement(p); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | } |
| 248 | |
| 249 | /// {@inheritDoc} |
| 250 | @Override |