-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathNInstanceType.java
More file actions
37 lines (30 loc) · 968 Bytes
/
NInstanceType.java
File metadata and controls
37 lines (30 loc) · 968 Bytes
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
/**
* Copyright 2009, Google Inc. All rights reserved.
* Licensed to PSF under a Contributor Agreement.
*/
package org.python.indexer.types;
import org.python.indexer.Scope;
/**
* Represents an instance of a class. Currently there is nothing in
* the indexer that needs to distinguish instances from classes -- both
* classes and their instances are merged into a single type.
*/
public class NInstanceType extends NType {
private NType classType;
public NInstanceType() {
classType = new NUnknownType();
}
public NInstanceType(NType c) {
this.setTable(c.getTable().copy(Scope.Type.INSTANCE));
this.getTable().addSuper(c.getTable());
this.getTable().setPath(c.getTable().getPath());
classType = c;
}
public NType getClassType() {
return classType;
}
@Override
public void printKids(CyclicTypeRecorder ctr, StringBuilder sb) {
classType.print(ctr, sb);
}
}