Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: pkg/analysis_server/lib/src/services/index/store/codec.dart

Issue 1087483006: Rename two more classes to prepare for the public API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart 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 services.src.index.store.codec; 5 library services.src.index.store.codec;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_server/src/services/index/index.dart'; 9 import 'package:analysis_server/src/services/index/index.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 175
176 /** 176 /**
177 * A helper that encodes/decodes [Relationship]s to/from integers. 177 * A helper that encodes/decodes [Relationship]s to/from integers.
178 */ 178 */
179 class RelationshipCodec { 179 class RelationshipCodec {
180 final StringCodec _stringCodec; 180 final StringCodec _stringCodec;
181 181
182 RelationshipCodec(this._stringCodec); 182 RelationshipCodec(this._stringCodec);
183 183
184 Relationship decode(int idIndex) { 184 RelationshipImpl decode(int idIndex) {
185 String id = _stringCodec.decode(idIndex); 185 String id = _stringCodec.decode(idIndex);
186 return Relationship.getRelationship(id); 186 return RelationshipImpl.getRelationship(id);
187 } 187 }
188 188
189 int encode(Relationship relationship) { 189 int encode(RelationshipImpl relationship) {
190 String id = relationship.identifier; 190 String id = relationship.identifier;
191 return _stringCodec.encode(id); 191 return _stringCodec.encode(id);
192 } 192 }
193 } 193 }
194 194
195 /** 195 /**
196 * A helper that encodes/decodes [String]s from/to integers. 196 * A helper that encodes/decodes [String]s from/to integers.
197 */ 197 */
198 class StringCodec { 198 class StringCodec {
199 /** 199 /**
(...skipping 17 matching lines...) Expand all
217 int encode(String name) { 217 int encode(String name) {
218 int index = nameToIndex[name]; 218 int index = nameToIndex[name];
219 if (index == null) { 219 if (index == null) {
220 index = _indexToName.length; 220 index = _indexToName.length;
221 nameToIndex[name] = index; 221 nameToIndex[name] = index;
222 _indexToName.add(name); 222 _indexToName.add(name);
223 } 223 }
224 return index; 224 return index;
225 } 225 }
226 } 226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698