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

Unified Diff: samples/chat/chat_server_lib.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/calculator/tape.dart ('k') | samples/dartcombat/grids.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/chat/chat_server_lib.dart
diff --git a/samples/chat/chat_server_lib.dart b/samples/chat/chat_server_lib.dart
index a5b4cc007ec4cf7601717074416d0fdb46e8ee0b..f04dbfa381bf47ac062e01a06faf0063946bf1b8 100644
--- a/samples/chat/chat_server_lib.dart
+++ b/samples/chat/chat_server_lib.dart
@@ -66,8 +66,8 @@ class User {
void markActivity() { _lastActive = new Date.now(); }
Duration idleTime(Date now) => now.difference(_lastActive);
- String get handle() => _handle;
- String get sessionId() => _sessionId;
+ String get handle => _handle;
+ String get sessionId => _sessionId;
String _handle;
String _sessionId;
@@ -92,9 +92,9 @@ class Message {
Message.timeout(this._from)
: _received = new Date.now(), _type = TIMEOUT;
- User get from() => _from;
- Date get received() => _received;
- String get message() => _message;
+ User get from => _from;
+ Date get received => _received;
+ String get message => _message;
void set messageNumber(int n) { _messageNumber = n; }
Map toMap() {
@@ -123,7 +123,7 @@ class Topic {
_nextMessageNumber = 0,
_callbacks = new Map();
- int get activeUsers() => _activeUsers.length;
+ int get activeUsers => _activeUsers.length;
User _userJoined(String handle) {
User user = new User(handle);
@@ -229,13 +229,13 @@ class ChatServerCommand {
: _command = START, _backlog = backlog, _logging = logging;
ChatServerCommand.stop() : _command = STOP;
- bool get isStart() => _command == START;
- bool get isStop() => _command == STOP;
+ bool get isStart => _command == START;
+ bool get isStop => _command == STOP;
- String get host() => _host;
- int get port() => _port;
- bool get logging() => _logging;
- int get backlog() => _backlog;
+ String get host => _host;
+ int get port => _port;
+ bool get logging => _logging;
+ int get backlog => _backlog;
int _command;
String _host;
@@ -259,14 +259,14 @@ class ChatServerStatus {
ChatServerStatus.stopped() : _state = STOPPED;
ChatServerStatus.error([this._error]) : _state = ERROR;
- bool get isStarting() => _state == STARTING;
- bool get isStarted() => _state == STARTED;
- bool get isStopping() => _state == STOPPING;
- bool get isStopped() => _state == STOPPED;
- bool get isError() => _state == ERROR;
+ bool get isStarting => _state == STARTING;
+ bool get isStarted => _state == STARTED;
+ bool get isStopping => _state == STOPPING;
+ bool get isStopped => _state == STOPPED;
+ bool get isError => _state == ERROR;
- int get state() => _state;
- String get message() {
+ int get state => _state;
+ String get message {
if (_message != null) return _message;
switch (_state) {
case STARTING: return "Server starting";
@@ -282,8 +282,8 @@ class ChatServerStatus {
}
}
- int get port() => _port;
- Dynamic get error() => _error;
+ int get port => _port;
+ Dynamic get error => _error;
int _state;
String _message;
@@ -655,7 +655,7 @@ class Rate {
}
// Returns the current rate of events for the time range.
- num get rate() {
+ num get rate {
_timePassed();
return _sum;
}
« no previous file with comments | « samples/calculator/tape.dart ('k') | samples/dartcombat/grids.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698