mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 08:39:33 +00:00
Sort server providers
This commit is contained in:
@@ -7,7 +7,7 @@ package org.parabot.core.desc;
|
|||||||
* @author Everel
|
* @author Everel
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ServerDescription {
|
public class ServerDescription implements Comparable<ServerDescription> {
|
||||||
private String serverName;
|
private String serverName;
|
||||||
private String author;
|
private String author;
|
||||||
private double revision;
|
private double revision;
|
||||||
@@ -37,4 +37,9 @@ public class ServerDescription {
|
|||||||
this.serverName, this.author, this.revision);
|
this.serverName, this.author, this.revision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo( ServerDescription o ) {
|
||||||
|
return this.getServerName().compareTo( o.getServerName() );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.parabot.environment.servers.ServerExecuter;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class for parsing server providers
|
* Abstract class for parsing server providers
|
||||||
@@ -42,8 +43,9 @@ public abstract class ServerParser {
|
|||||||
Core.verbose("Server providers parsed.");
|
Core.verbose("Server providers parsed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<ServerDescription, ServerExecuter> SORTED_SERVER_CACHE = new TreeMap<ServerDescription, ServerExecuter>( SERVER_CACHE );
|
||||||
|
|
||||||
return SERVER_CACHE.keySet().toArray(new ServerDescription[SERVER_CACHE.size()]);
|
return SORTED_SERVER_CACHE.keySet().toArray(new ServerDescription[SORTED_SERVER_CACHE.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user