01: /*
02: * Copyright (C) 2008 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 01. January 2008 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.benchmark.cache.targets;
12:
13: import com.thoughtworks.xstream.tools.benchmark.Target;
14:
15: import java.io.File;
16: import java.math.BigInteger;
17: import java.net.MalformedURLException;
18: import java.net.URL;
19: import java.util.ArrayList;
20: import java.util.List;
21: import java.util.Locale;
22:
23: /**
24: * Target containing basic types.
25: *
26: * @author Jörg Schaible
27: * @since 1.3
28: */
29: public class BasicTarget implements Target {
30:
31: private List list;
32:
33: public BasicTarget() {
34: list = new ArrayList();
35: list.add(new Integer(1));
36: list.add(new Byte((byte) 2));
37: list.add(new Short((short) 3));
38: list.add(new Long(4));
39: list.add(new BigInteger("5"));
40: list.add("Profile");
41: list.add(Boolean.TRUE);
42: list.add(new Float(1.2f));
43: list.add(new Double(1.2f));
44: try {
45: list.add(new URL("http://xstream.codehaus.org"));
46: } catch (MalformedURLException e) {
47: throw new RuntimeException(e);
48: }
49: list.add(new File("profile.txt"));
50: list.add(Locale.ENGLISH);
51: }
52:
53: public boolean isEqual(Object other) {
54: return list.equals(other);
55: }
56:
57: public Object target() {
58: return list;
59: }
60:
61: public String toString() {
62: return "Basic types";
63: }
64: }
|