-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathNClassType.java
More file actions
51 lines (41 loc) · 1.14 KB
/
NClassType.java
File metadata and controls
51 lines (41 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Copyright 2009, Google Inc. All rights reserved.
* Licensed to PSF under a Contributor Agreement.
*/
package org.python.indexer.types;
import org.python.indexer.Scope;
import org.python.indexer.Util;
public class NClassType extends NType {
private String name;
public NClassType() {
this("<unknown>", null);
}
public NClassType(String name, Scope parent) {
this.name = name;
this.setTable(new Scope(parent, Scope.Type.CLASS));
if (parent != null) {
this.getTable().setPath(parent.extendPath(name));
} else {
this.getTable().setPath(name);
}
}
public NClassType(String name, Scope parent, NClassType superClass) {
this(name, parent);
if (superClass != null) {
addSuper(superClass);
}
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void addSuper(NType sp) {
getTable().addSuper(sp.getTable());
}
@Override
public void printKids(CyclicTypeRecorder ctr, StringBuilder sb) {
sb.append(name);
}
}