Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#32 Implemented constructor for concrete concepts.
- Loading branch information
Quenio dos Santos
committed
Mar 23, 2017
1 parent
966df1b
commit 9e60e0a
Showing
12 changed files
with
215 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
58 changes: 58 additions & 0 deletions
58
...nerator/src/test/resources/java_lang/class/class2__concept_concrete_ancestor_multiple.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
class BookImpl implements Book | ||
{ | ||
private final Base base; | ||
private final Product product; | ||
private final StockItem stockItem; | ||
|
||
private final String title; | ||
|
||
public BookImpl(String baseProperty, String description, Integer quantity, String title) | ||
{ | ||
this( | ||
Base.create(baseProperty), | ||
Product.create(base, description), | ||
StockItem.create(base, quantity), | ||
title | ||
); | ||
} | ||
|
||
public BookImpl(Base base, Product product, StockItem stockItem, String title) | ||
{ | ||
this.base = base; | ||
this.product = product; | ||
this.stockItem = stockItem; | ||
this.title = title; | ||
} | ||
|
||
public String getTitle() | ||
{ | ||
return title; | ||
} | ||
|
||
public String getBaseProperty() | ||
{ | ||
return base.getBaseProperty(); | ||
} | ||
|
||
public String getDescription() | ||
{ | ||
return product.getDescription(); | ||
} | ||
|
||
public Integer getQuantity() | ||
{ | ||
return stockItem.getQuantity(); | ||
} | ||
|
||
public String toString() | ||
{ | ||
return new StringBuilder(Book.class.getSimpleName()) | ||
.append('(') | ||
.append("baseProperty=").append(String.format("\"%s\"", getBaseProperty())).append(", ") | ||
.append("description=").append(String.format("\"%s\"", getDescription())).append(", ") | ||
.append("quantity=").append(String.format("\"%s\"", getQuantity())).append(", ") | ||
.append("title=").append(String.format("\"%s\"", getTitle())) | ||
.append(')') | ||
.toString(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ler/cml-generator/src/test/resources/java_lang/class/class__concept_abstract_ancestor.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
abstract class Book extends Product | ||
{ | ||
private final String title; | ||
|
||
public Book(String description, String title) | ||
{ | ||
super(description); | ||
this.title = title; | ||
} | ||
|
||
public String getTitle() | ||
{ | ||
return title; | ||
} | ||
|
||
public String toString() | ||
{ | ||
return new StringBuilder(Book.class.getSimpleName()) | ||
.append('(') | ||
.append("description=").append(String.format("\"%s\"", getDescription())).append(", ") | ||
.append("title=").append(String.format("\"%s\"", getTitle())) | ||
.append(')') | ||
.toString(); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.