66 lines
1.5 KiB
Java
66 lines
1.5 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package javax.baja.spy;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import javax.baja.spy.ISpyDir;
|
|
import javax.baja.spy.Spy;
|
|
import javax.baja.spy.SpyWriter;
|
|
|
|
public class SpyDir
|
|
extends Spy
|
|
implements ISpyDir {
|
|
private HashMap map;
|
|
private ArrayList list;
|
|
|
|
public void write(SpyWriter spyWriter) throws Exception {
|
|
spyWriter.w("<ul>");
|
|
String[] stringArray = this.list();
|
|
int n = 0;
|
|
while (n < stringArray.length) {
|
|
String string = stringArray[n];
|
|
String string2 = this.find(string).getTitle();
|
|
if (string2 == null) {
|
|
string2 = string;
|
|
}
|
|
spyWriter.w("<li>").a(stringArray[n], string2).w("</li>\n");
|
|
++n;
|
|
}
|
|
spyWriter.w("</ul>");
|
|
}
|
|
|
|
public String[] list() {
|
|
if (this.list == null) {
|
|
return new String[0];
|
|
}
|
|
return this.list.toArray(new String[this.list.size()]);
|
|
}
|
|
|
|
public Spy find(String string) {
|
|
if (this.map == null) {
|
|
return null;
|
|
}
|
|
return (Spy)this.map.get(string);
|
|
}
|
|
|
|
public void add(String string, Spy spy) {
|
|
if (this.map == null) {
|
|
this.map = new HashMap();
|
|
this.list = new ArrayList();
|
|
}
|
|
this.map.put(string, spy);
|
|
this.list.add(string);
|
|
}
|
|
|
|
public void remove(String string) {
|
|
if (this.map == null) {
|
|
return;
|
|
}
|
|
this.map.remove(string);
|
|
this.list.remove(string);
|
|
}
|
|
}
|
|
|