Skip to content

Commit 5432f67

Browse files
committed
CR: comments
1 parent d913ce7 commit 5432f67

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/types/scope/AtomTypeDefinition.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,26 @@ public final class AtomTypeDefinition {
77
private final String name;
88
private final List<Constructor> constructors;
99

10+
/**
11+
* Constructs the type definition.
12+
*
13+
* @param name The simple name of the type, e.g. the "Name" in `type Name`
14+
* @param constructors the list of constructor representations
15+
*/
1016
public AtomTypeDefinition(String name, List<Constructor> constructors) {
1117
this.name = name;
1218
this.constructors = constructors;
1319
}
1420

21+
/** Returns the short name of the type. */
1522
public String getName() {
1623
return name;
1724
}
1825

26+
/**
27+
* Returns the constructor of the type with the given name, or {@code null} if a constructor with
28+
* that name does not exist.
29+
*/
1930
public Constructor getConstructor(String name) {
2031
return constructors.stream().filter(c -> c.name().equals(name)).findFirst().orElse(null);
2132
}

0 commit comments

Comments
 (0)