public class NUnionType extends NType
NType.CyclicTypeRecorderLIBRARY_URL, REFERENCE_URL, TUTORIAL_URL| Constructor and Description |
|---|
NUnionType() |
NUnionType(NType... initialTypes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addType(NType t) |
boolean |
contains(NType t) |
NType |
firstKnownAlternate()
Returns the first alternate whose type is not unknown.
|
NType |
firstKnownNonNullAlternate()
Returns the first alternate whose type is not unknown and
is not
Indexer#idx.builtins.None. |
java.util.Set<NType> |
getTypes() |
static NUnionType |
newUnion(NType... types) |
void |
printKids(NType.CyclicTypeRecorder ctr,
java.lang.StringBuilder sb)
Internal method to support printing in the presence of type-graph cycles.
|
void |
setTypes(java.util.Set<NType> types) |
static NType |
union(NType u,
NType v) |
asClassType, asDictType, asFuncType, asInstanceType, asListType, asModuleType, asTupleType, asUnionType, asUnknownType, follow, getTable, isClassType, isDictType, isFuncType, isInstanceType, isListType, isModuleType, isNative, isNumType, isStrType, isTupleType, isUnionType, isUnknownType, print, setTable, toStringpublic NUnionType()
public NUnionType(NType... initialTypes)
public void setTypes(java.util.Set<NType> types)
public java.util.Set<NType> getTypes()
public void addType(NType t)
public boolean contains(NType t)
public static NUnionType newUnion(NType... types)
public NType firstKnownAlternate()
null if none foundpublic NType firstKnownNonNullAlternate()
Indexer#idx.builtins.None.None alternate, or null if none foundpublic void printKids(NType.CyclicTypeRecorder ctr, java.lang.StringBuilder sb)
NType