| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011, the Dart project authors. | 2 * Copyright (c) 2014, the Dart project authors. |
| 3 * | 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * | 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * | 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| 11 * or implied. See the License for the specific language governing permissions a
nd limitations under | 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
| 12 * the License. | 12 * the License. |
| 13 */ | 13 */ |
| 14 package com.google.dart.indexer.workspace.index; | |
| 15 | 14 |
| 16 public abstract class QueueState { | 15 package com.google.dart.java2dart; |
| 17 | 16 |
| 18 public static final QueueState NORMAL = new QueueState("NORMAL") { | 17 import com.google.common.collect.Maps; |
| 19 | 18 |
| 20 @Override | 19 import java.util.Map; |
| 21 public boolean isAbnormal() { | |
| 22 return false; | |
| 23 } | |
| 24 | 20 |
| 25 }; | 21 /** |
| 22 * Value object for an annotation. |
| 23 */ |
| 24 public class ParsedAnnotation { |
| 25 private final String name; |
| 26 private final Map<String, Object> values = Maps.newHashMap(); |
| 26 | 27 |
| 27 public static final QueueState NEEDS_RESYNC = new QueueState("NEEDS_RESYNC") { | 28 public ParsedAnnotation(String name) { |
| 28 | |
| 29 }; | |
| 30 | |
| 31 public static final QueueState NEEDS_REBUILD = new QueueState("NEEDS_REBUILD")
{ | |
| 32 | |
| 33 }; | |
| 34 | |
| 35 private final String name; | |
| 36 | |
| 37 private QueueState(String name) { | |
| 38 this.name = name; | 29 this.name = name; |
| 39 } | 30 } |
| 40 | 31 |
| 41 public boolean isAbnormal() { | 32 public Object get(String key) { |
| 42 return true; | 33 return values.get(key); |
| 34 } |
| 35 |
| 36 public String getName() { |
| 37 return name; |
| 38 } |
| 39 |
| 40 public void put(String key, Object value) { |
| 41 values.put(key, value); |
| 43 } | 42 } |
| 44 | 43 |
| 45 @Override | 44 @Override |
| 46 public String toString() { | 45 public String toString() { |
| 47 return name; | 46 return name + values; |
| 48 } | 47 } |
| 49 | |
| 50 } | 48 } |
| OLD | NEW |