Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a87a690

Browse files
author
Vincent Cantin
committed
Added classes representing some generic diffelts (a.k.a. "elements of difference").
1 parent cc1d5e6 commit a87a690

File tree

10 files changed

+180
-0
lines changed

10 files changed

+180
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A diffelt representing the addition of a content element.
5+
*/
6+
public class AddDiffelt implements Diffelt {
7+
8+
/**
9+
* The content element which is added.
10+
*/
11+
public ContentElementData data;
12+
13+
/**
14+
* The location where the content element is added to.
15+
*/
16+
public ContentLocation location;
17+
18+
/**
19+
* The reference to the content element after being added.
20+
*/
21+
public ContentElementReference reference;
22+
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* The data of a content element.
5+
*/
6+
public interface ContentElementData {
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A reference to a content element.
5+
*/
6+
public interface ContentElementReference {
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A location inside a content.
5+
*/
6+
public interface ContentLocation {
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A Diffelt is an element of difference.
5+
*
6+
* An set of difference elements is used to describe a change.
7+
* The difference elements may or may not depend on each other.
8+
* Their relations can be represented as a graph.
9+
*/
10+
public interface Diffelt {
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A dependency between 2 diffelts.
5+
*
6+
* The "dependent" diffelt depends on the "dependency" diffelt.
7+
*/
8+
public class DiffeltDependency {
9+
10+
public final Diffelt dependent;
11+
public final Diffelt dependency;
12+
13+
public DiffeltDependency(Diffelt dependent, Diffelt dependency) {
14+
this.dependent = dependent;
15+
this.dependency = dependency;
16+
}
17+
18+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A diffelt representing the movement of a content element.
5+
*/
6+
public class MoveDiffelt implements Diffelt {
7+
8+
/**
9+
* The content element which is moved.
10+
*/
11+
public ContentElementData data;
12+
13+
/**
14+
* The location of the content element before being moved.
15+
*/
16+
public ContentLocation locationBefore;
17+
18+
/**
19+
* The location of the content element after being moved.
20+
*/
21+
public ContentLocation locationAfter;
22+
23+
/**
24+
* A reference to the content element before being moved.
25+
*/
26+
public ContentElementReference referenceBefore;
27+
28+
/**
29+
* A reference to the content element after being moved.
30+
*/
31+
public ContentElementReference referenceAfter;
32+
33+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A diffelt representing the removal of a content element.
5+
*/
6+
public class RemoveDiffelt implements Diffelt {
7+
8+
/**
9+
* The content element which is removed.
10+
*/
11+
public ContentElementData data;
12+
13+
/**
14+
* The location where the content element is removed from.
15+
*/
16+
public ContentLocation location;
17+
18+
/**
19+
* The reference to the content element before being removed.
20+
*/
21+
public ContentElementReference reference;
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A diffelt representing the rename of a content element.
5+
*/
6+
public class RenameDiffelt implements Diffelt {
7+
8+
/**
9+
* The content element which is moved.
10+
*/
11+
public ContentElementData data;
12+
13+
/**
14+
* The reference to the content element before being renamed.
15+
*/
16+
public ContentElementReference referenceBefore;
17+
18+
/**
19+
* The reference to the content element after being renamed.
20+
*/
21+
public ContentElementReference referenceAfter;
22+
23+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.lemoulinstudio.sdiff.diffelt;
2+
3+
/**
4+
* A diffelt representing the replacement or modification of a content element.
5+
*/
6+
public class ReplaceDiffelt implements Diffelt {
7+
8+
/**
9+
* The content element before being replaced.
10+
*/
11+
public ContentElementData dataBefore;
12+
13+
/**
14+
* The content element after being replaced.
15+
*/
16+
public ContentElementData dataAfter;
17+
18+
/**
19+
* The location of the content element.
20+
*/
21+
public ContentLocation location;
22+
23+
/**
24+
* A reference to the content element.
25+
*/
26+
public ContentElementReference reference;
27+
28+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /