📄 typeimpl.java
字号:
/* gnu.classpath.tools.gjdoc.TypeImpl Copyright (C) 2001 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version. GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING. If not, write to theFree Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307 USA. */package gnu.classpath.tools.gjdoc;import com.sun.javadoc.*;import java.util.Collections;import java.util.Set;import java.util.HashSet;public class TypeImpl implements Type, WritableType { private String packageName; private String typeName; private String dimension; TypeImpl(String packageName, String typeName, String dimension) { this.packageName=packageName; this.typeName=typeName; this.dimension=dimension; if (typeName.indexOf('[') >= 0 || typeName.indexOf(']') >= 0) { throw new RuntimeException("Typename must not contain dimension information."); } } public ClassDoc asClassDoc() { if (this instanceof ClassDoc) return ((ClassDocImpl)(ClassDoc)this).getBaseClassDoc(); else return null; } public String typeName() { return typeName; } public String qualifiedTypeName() { return (packageName!=null)?(packageName+"."+typeName):(typeName); } public String dimension() { return dimension; } public void setDimension(String dimension) { this.dimension = dimension; } public String toString() { return "Type{"+qualifiedTypeName()+dimension()+"}"; } public Object clone() throws CloneNotSupportedException { return super.clone(); } public boolean isPrimitive() { return null == packageName && primitiveNames.contains(typeName); } private static final Set primitiveNames; static { Set _primitiveNames = new HashSet(); _primitiveNames.add("boolean"); _primitiveNames.add("char"); _primitiveNames.add("byte"); _primitiveNames.add("short"); _primitiveNames.add("int"); _primitiveNames.add("long"); _primitiveNames.add("float"); _primitiveNames.add("double"); primitiveNames = Collections.unmodifiableSet(_primitiveNames); } public TypeVariable asTypeVariable() { if (this instanceof TypeVariable) return (TypeVariable) this; else return null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -