本文整理了Java中com.sun.tools.javac.code.Types.rank()
方法的一些代码示例,展示了Types.rank()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.rank()
方法的具体详情如下:
包路径:com.sun.tools.javac.code.Types
类名称:Types
方法名:rank
[英]The rank of a class is the length of the longest path between the class and java.lang.Object in the class inheritance graph. Undefined for all but reference types.
[中]类的秩是类和java之间最长路径的长度。类继承图中的lang.对象。除引用类型外,其他所有类型均未定义。
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
/**
* A total ordering between type symbols that refines the
* class inheritance graph.
*
* Typevariables always precede other kinds of symbols.
*/
public final boolean precedes(TypeSymbol that, Types types) {
if (this == that)
return false;
if (this.type.tag == that.type.tag) {
if (this.type.tag == CLASS) {
return
types.rank(that.type) < types.rank(this.type) ||
types.rank(that.type) == types.rank(this.type) &&
that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
} else if (this.type.tag == TYPEVAR) {
return types.isSubtype(this.type, that.type);
}
}
return this.type.tag == TYPEVAR;
}
代码示例来源:origin: sc.fiji/javac
/**
* A total ordering between type symbols that refines the
* class inheritance graph.
*
* Typevariables always precede other kinds of symbols.
*/
public final boolean precedes(TypeSymbol that, Types types) {
if (this == that)
return false;
if (this.type.tag == that.type.tag) {
if (this.type.tag == CLASS) {
return
types.rank(that.type) < types.rank(this.type) ||
types.rank(that.type) == types.rank(this.type) &&
that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
} else if (this.type.tag == TYPEVAR) {
return types.isSubtype(this.type, that.type);
}
}
return this.type.tag == TYPEVAR;
}
代码示例来源:origin: sc.fiji/javac
cls.rank_field = 0;
else {
int r = rank(supertype(cls));
for (List<Type> l = interfaces(cls);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r)
r = rank(l.head);
TypeVar tvar = (TypeVar)t;
if (tvar.rank_field < 0) {
int r = rank(supertype(tvar));
for (List<Type> l = interfaces(tvar);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r) r = rank(l.head);
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
cls.rank_field = 0;
else {
int r = rank(supertype(cls));
for (List<Type> l = interfaces(cls);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r)
r = rank(l.head);
TypeVar tvar = (TypeVar)t;
if (tvar.rank_field < 0) {
int r = rank(supertype(tvar));
for (List<Type> l = interfaces(tvar);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r) r = rank(l.head);
代码示例来源:origin: konsoletyper/teavm-javac
cls.rank_field = 0;
else {
int r = rank(supertype(cls));
for (List<Type> l = interfaces(cls);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r)
r = rank(l.head);
TypeVar tvar = (TypeVar)t;
if (tvar.rank_field < 0) {
int r = rank(supertype(tvar));
for (List<Type> l = interfaces(tvar);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r) r = rank(l.head);
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
cls.rank_field = 0;
else {
int r = rank(supertype(cls));
for (List<Type> l = interfaces(cls);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r)
r = rank(l.head);
TypeVar tvar = (TypeVar)t;
if (tvar.rank_field < 0) {
int r = rank(supertype(tvar));
for (List<Type> l = interfaces(tvar);
l.nonEmpty();
l = l.tail) {
if (rank(l.head) > r) r = rank(l.head);
代码示例来源:origin: konsoletyper/teavm-javac
/**
* A partial ordering between type symbols that refines the
* class inheritance graph.
*
* Type variables always precede other kinds of symbols.
*/
public final boolean precedes(TypeSymbol that, Types types) {
if (this == that)
return false;
if (type.hasTag(that.type.getTag())) {
if (type.hasTag(CLASS)) {
return
types.rank(that.type) < types.rank(this.type) ||
types.rank(that.type) == types.rank(this.type) &&
that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
} else if (type.hasTag(TYPEVAR)) {
return types.isSubtype(this.type, that.type);
}
}
return type.hasTag(TYPEVAR);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
/**
* A total ordering between type symbols that refines the
* class inheritance graph.
*
* Typevariables always precede other kinds of symbols.
*/
public final boolean precedes(TypeSymbol that, Types types) {
if (this == that)
return false;
if (type.hasTag(that.type.getTag())) {
if (type.hasTag(CLASS)) {
return
types.rank(that.type) < types.rank(this.type) ||
types.rank(that.type) == types.rank(this.type) &&
that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
} else if (type.hasTag(TYPEVAR)) {
return types.isSubtype(this.type, that.type);
}
}
return type.hasTag(TYPEVAR);
}
内容来源于网络,如有侵权,请联系作者删除!