OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package org.chromium.content.browser.input; | |
6 | |
7 /** | |
8 * Date/time suggestion container used to store information for each suggestion that will be shown | |
9 * in the suggestion list dialog. Keep in sync with date_time_suggestion.h. | |
10 */ | |
11 public class DateTimeSuggestion { | |
bulach
2013/12/03 14:22:29
nit: can this be package private?
keishi
2013/12/03 16:52:34
Done.
| |
12 public final double value; | |
bulach
2013/12/03 14:22:29
nit: I think we normally use private fields and ge
keishi
2013/12/03 16:52:34
Done.
| |
13 public final String localizedValue; | |
14 public final String label; | |
15 | |
16 /** | |
17 * Constructs a color suggestion container. | |
18 * @param value The suggested date/time value. | |
19 * @param localizedValue The suggested value localized. | |
20 * @param label The label for the suggestion. | |
21 */ | |
22 public DateTimeSuggestion(double value, String localizedValue, String label) { | |
23 this.value = value; | |
24 this.localizedValue = localizedValue; | |
25 this.label = label; | |
26 } | |
27 | |
28 @Override | |
29 public boolean equals(Object object) { | |
30 if (!(object instanceof DateTimeSuggestion)) { | |
31 return false; | |
32 } | |
33 final DateTimeSuggestion other = (DateTimeSuggestion) object; | |
34 return value == other.value && | |
35 localizedValue == other.localizedValue && | |
36 label == other.label; | |
37 } | |
38 | |
39 @Override | |
40 public int hashCode() { | |
41 int hash = 31; | |
42 hash = 37 * hash + (int) value; | |
43 hash = 37 * hash + localizedValue.hashCode(); | |
44 hash = 37 * hash + label.hashCode(); | |
45 return hash; | |
46 } | |
47 } | |
OLD | NEW |