Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8201015b
Commit
8201015b
authored
Mar 01, 2016
by
Phil Quitslund
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2285 from flutter/cassowary_cleanup
@override annotation cleanup.
parents
9ce6bff5
8574e442
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
0 deletions
+14
-0
constant_member.dart
packages/cassowary/lib/constant_member.dart
+3
-0
constraint.dart
packages/cassowary/lib/constraint.dart
+1
-0
equation_member.dart
packages/cassowary/lib/equation_member.dart
+1
-0
expression.dart
packages/cassowary/lib/expression.dart
+8
-0
variable.dart
packages/cassowary/lib/variable.dart
+1
-0
No files found.
packages/cassowary/lib/constant_member.dart
View file @
8201015b
...
...
@@ -5,12 +5,15 @@
part of
cassowary
;
class
ConstantMember
extends
_EquationMember
{
@override
final
double
value
;
@override
bool
get
isConstant
=>
true
;
ConstantMember
(
this
.
value
);
@override
Expression
asExpression
()
=>
new
Expression
([],
this
.
value
);
}
...
...
packages/cassowary/lib/constraint.dart
View file @
8201015b
...
...
@@ -15,6 +15,7 @@ class Constraint {
Constraint
operator
|(
double
p
)
=>
this
..
priority
=
p
;
@override
String
toString
()
{
StringBuffer
buffer
=
new
StringBuffer
();
buffer
.
write
(
expression
.
toString
());
...
...
packages/cassowary/lib/equation_member.dart
View file @
8201015b
...
...
@@ -25,6 +25,7 @@ abstract class _EquationMember {
Expression
operator
/(
_EquationMember
m
)
=>
asExpression
()
/
m
;
@override
int
get
hashCode
=>
throw
"An equation member is not comparable and cannot be added to collections"
;
}
packages/cassowary/lib/expression.dart
View file @
8201015b
...
...
@@ -9,8 +9,10 @@ class Expression extends _EquationMember {
final
double
constant
;
@override
bool
get
isConstant
=>
terms
.
length
==
0
;
@override
double
get
value
=>
terms
.
fold
(
constant
,
(
value
,
term
)
=>
value
+
term
.
value
);
Expression
(
this
.
terms
,
this
.
constant
);
...
...
@@ -18,6 +20,7 @@ class Expression extends _EquationMember {
:
this
.
terms
=
new
List
<
Term
>.
from
(
expr
.
terms
),
this
.
constant
=
expr
.
constant
;
@override
Expression
asExpression
()
=>
this
;
Constraint
_createConstraint
(
...
...
@@ -51,15 +54,19 @@ class Expression extends _EquationMember {
return
null
;
}
@override
Constraint
operator
>=(
_EquationMember
value
)
=>
_createConstraint
(
value
,
Relation
.
greaterThanOrEqualTo
);
@override
Constraint
operator
<=(
_EquationMember
value
)
=>
_createConstraint
(
value
,
Relation
.
lessThanOrEqualTo
);
@override
Constraint
equals
(
_EquationMember
value
)
=>
_createConstraint
(
value
,
Relation
.
equalTo
);
@override
Expression
operator
+(
_EquationMember
m
)
{
if
(
m
is
ConstantMember
)
{
return
new
Expression
(
new
List
.
from
(
terms
),
constant
+
m
.
value
);
...
...
@@ -83,6 +90,7 @@ class Expression extends _EquationMember {
return
null
;
}
@override
Expression
operator
-(
_EquationMember
m
)
{
if
(
m
is
ConstantMember
)
{
return
new
Expression
(
new
List
.
from
(
terms
),
constant
-
m
.
value
);
...
...
packages/cassowary/lib/variable.dart
View file @
8201015b
...
...
@@ -23,5 +23,6 @@ class Variable {
String
get
debugName
=>
_elvis
(
name
,
'variable
$_tick
'
);
@override
String
toString
()
=>
debugName
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment