switched code to use nicer iteration over Map
This commit is contained in:
@@ -44,10 +44,8 @@ abstract class Tag(val name : String) : Element() {
|
|||||||
builder.append("<")
|
builder.append("<")
|
||||||
builder.append(name)
|
builder.append(name)
|
||||||
if (!attributes.isEmpty()) {
|
if (!attributes.isEmpty()) {
|
||||||
for (e in attributes.entrySet()) {
|
for (e in attributes) {
|
||||||
if (e != null) {
|
builder.append(" ${e.key}=\"${e.value}\"")
|
||||||
builder.append(" ${e.getKey()}=\"${e.getValue()}\"")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (children.isEmpty()) {
|
if (children.isEmpty()) {
|
||||||
|
|||||||
@@ -70,20 +70,15 @@ class KDocConfig() {
|
|||||||
* Resolves a link to the given class name
|
* Resolves a link to the given class name
|
||||||
*/
|
*/
|
||||||
fun resolveLink(packageName: String): String {
|
fun resolveLink(packageName: String): String {
|
||||||
// TODO should be able to do something like
|
for (e in packagePrefixToUrls) {
|
||||||
// for (e in packageUrls.filterNotNull()) {
|
val p = e.key
|
||||||
val entrySet = packagePrefixToUrls.entrySet()
|
val url = e.value
|
||||||
if (entrySet != null) {
|
if (p != null && url != null) {
|
||||||
for (e in entrySet) {
|
if (packageName.startsWith(p)) {
|
||||||
val p = e?.getKey()
|
return url
|
||||||
val url = e?.getValue()
|
|
||||||
if (p != null && url != null) {
|
|
||||||
if (packageName.startsWith(p)) {
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (missingPackageUrls.add(packageName)) {
|
if (missingPackageUrls.add(packageName)) {
|
||||||
println("Warning: could not find external link to package: $packageName")
|
println("Warning: could not find external link to package: $packageName")
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -96,8 +96,8 @@ ${stylesheets()}
|
|||||||
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">Extensions</FONT>
|
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">Extensions</FONT>
|
||||||
<FONT CLASS="FrameItemFont">
|
<FONT CLASS="FrameItemFont">
|
||||||
<BR>""")
|
<BR>""")
|
||||||
for (e in map.entrySet()) {
|
for (e in map) {
|
||||||
val c = e?.getKey()
|
val c = e.key
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
println("""<A HREF="${extensionsHref(pkg, c)}" title="extensions functions on class ${c.name} from ${pkg.name}" target="classFrame"><I>${c.name}</I></A>
|
println("""<A HREF="${extensionsHref(pkg, c)}" title="extensions functions on class ${c.name} from ${pkg.name}" target="classFrame"><I>${c.name}</I></A>
|
||||||
<BR>""")
|
<BR>""")
|
||||||
|
|||||||
Vendored
+6
-6
@@ -136,9 +136,9 @@ ${pkg.detailedDescription(this)}
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
val groupMap = pkg.groupClassMap()
|
val groupMap = pkg.groupClassMap()
|
||||||
for (e in groupMap.entrySet()) {
|
for (e in groupMap) {
|
||||||
val group = e?.getKey() ?: "Other"
|
val group = e.key ?: "Other"
|
||||||
val list = e?.getValue()
|
val list = e.value
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
println(""" <h3>$group</h3>
|
println(""" <h3>$group</h3>
|
||||||
|
|
||||||
@@ -275,13 +275,13 @@ Copyright © 2010-2012. All Rights Reserved.
|
|||||||
<B>Extensions Summary</B></FONT></TH>
|
<B>Extensions Summary</B></FONT></TH>
|
||||||
</TR>""")
|
</TR>""")
|
||||||
|
|
||||||
for (e in map.entrySet()) {
|
for (e in map) {
|
||||||
val c = e?.getKey()
|
val c = e.key
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
println("""<TR BGCOLOR="white" CLASS="TableRowColor">
|
println("""<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||||
<TD WIDTH="15%"><B><A HREF="${extensionsHref(pkg, c)}" title="extensions on ${pkg.name}">${c.name}</A></B></TD>
|
<TD WIDTH="15%"><B><A HREF="${extensionsHref(pkg, c)}" title="extensions on ${pkg.name}">${c.name}</A></B></TD>
|
||||||
<TD>""")
|
<TD>""")
|
||||||
val list = e?.getValue()
|
val list = e.value
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
val functions = filterDuplicateNames(list)
|
val functions = filterDuplicateNames(list)
|
||||||
for (f in functions) {
|
for (f in functions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user