Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LibLaserCut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Elektronikföreningen Admittansen
LibLaserCut
Commits
11948a00
Commit
11948a00
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
DitheringAlgorithm has equals mehtod which respects properties
parent
8845edce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/com/t_oster/liblasercut/dithering/DitheringAlgorithm.java
+39
-0
39 additions, 0 deletions
...com/t_oster/liblasercut/dithering/DitheringAlgorithm.java
with
39 additions
and
0 deletions
src/com/t_oster/liblasercut/dithering/DitheringAlgorithm.java
+
39
−
0
View file @
11948a00
...
...
@@ -80,4 +80,43 @@ public abstract class DitheringAlgorithm extends TimeIntensiveOperation implemen
@Override
public
abstract
String
toString
();
@Override
public
boolean
equals
(
Object
o
)
{
if
(
o
==
null
||
!
getClass
().
equals
(
o
.
getClass
()))
{
return
false
;
}
final
DitheringAlgorithm
other
=
(
DitheringAlgorithm
)
o
;
String
[]
own
=
this
.
getPropertyKeys
();
String
[]
ot
=
other
.
getPropertyKeys
();
if
(
own
.
length
!=
ot
.
length
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
own
.
length
;
i
++)
{
String
key
=
own
[
i
];
if
(!
key
.
equals
(
ot
[
i
]))
{
return
false
;
}
else
if
(!
getProperty
(
key
).
equals
(
other
.
getProperty
(
key
)))
{
return
false
;
}
}
return
true
;
}
@Override
public
int
hashCode
()
{
int
hash
=
7
;
for
(
String
key
:
this
.
getPropertyKeys
())
{
hash
+=
this
.
getProperty
(
key
).
hashCode
();
}
return
hash
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment