OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library servicec.targets; | 5 library servicec.targets; |
6 | 6 |
7 // Using pre-Dart 1.8 enums, to allow masking. | 7 // Using pre-Dart 1.8 enums, to allow masking. |
8 class Target { | 8 class Target { |
9 static const JAVA = const Target._(1); | 9 static const JAVA = const Target._(1); |
10 static const CC = const Target._(2); | 10 static const CC = const Target._(2); |
11 // When editing: new targets should be a power of 2, and ALL should be the | 11 // When editing: new targets should be a power of 2, and ALL should be the |
12 // next power of 2 minus 1. | 12 // next power of 2 minus 1. |
13 static const ALL = const Target._(3); | 13 static const ALL = const Target._(3); |
14 | 14 |
15 static get values => [JAVA, CC, ALL]; | 15 static get values => [JAVA, CC, ALL]; |
16 | 16 |
17 final int value; | 17 final int value; |
18 | 18 |
19 const Target._(this.value); | 19 const Target._(this.value); |
20 | 20 |
21 bool includes(Target t) { | 21 bool includes(Target t) { |
22 return value & t.value > 0; | 22 return value & t.value > 0; |
23 } | 23 } |
24 } | 24 } |
OLD | NEW |