Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

CSServerTree
Class CSServerTree  view CSServerTree download CSServerTree.java

java.lang.Object
  extended byCSServerTree.CSServerTree

public class CSServerTree
extends java.lang.Object

The CSServerTree object creates a binary search tree (BST) out of CounterStrike game servers. The servers can be sorted with by: name, IP, ping, players, max players, and mapname. (c) 2002 Mitch Davis

Version:
0.2a

Field Summary
private  int currentSort
           
private  CSServerTree.CSServerNode.CSServerNode head
           
private  int size
           
 
Constructor Summary
CSServerTree()
          Default constructor, initializes to a null tree and sets the size to zero
CSServerTree(jcsq.CSServer server, jcsq.serverinfo.ServerInfo info)
          Constructor sets the head of the BST to a CSServerNode object with server and info stored
 
Method Summary
 void add(jcsq.CSServer server, jcsq.serverinfo.ServerInfo info)
          adds a CSServer/SeverInfo data pair into the BST
private  void addR(CSServerTree.CSServerNode.CSServerNode point, CSServerTree.CSServerNode.CSServerNode toAdd)
           
private  int compare(jcsq.CSServer server1, jcsq.serverinfo.ServerInfo info1, jcsq.CSServer server2, jcsq.serverinfo.ServerInfo info2, int compareType)
           
 jcsq.serverinfo.ServerInfo getInfo(int index)
          use for array-type access in the BST
 jcsq.serverinfo.ServerInfo[] getInfoArray()
           
 java.util.ArrayList getInfoList()
           
 jcsq.CSServer getServer(int index)
          use for array-type access in the BST
 jcsq.CSServer[] getServerArray()
           
 java.util.ArrayList getServerList()
           
private  void lister_i(CSServerTree.CSServerNode.CSServerNode point, java.util.ArrayList list)
           
private  void lister(CSServerTree.CSServerNode.CSServerNode point, java.util.ArrayList list)
           
 void sortBy(int sortMethod)
          re-hash the servers, use values for sortMethod as the following: 1 - server name 2 - IP 3 - ping 4 - players connected 5 - max players 6 - mapname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

head

private CSServerTree.CSServerNode.CSServerNode head

size

private int size

currentSort

private int currentSort
Constructor Detail

CSServerTree

public CSServerTree()
Default constructor, initializes to a null tree and sets the size to zero


CSServerTree

public CSServerTree(jcsq.CSServer server,
                    jcsq.serverinfo.ServerInfo info)
Constructor sets the head of the BST to a CSServerNode object with server and info stored

Method Detail

add

public void add(jcsq.CSServer server,
                jcsq.serverinfo.ServerInfo info)
adds a CSServer/SeverInfo data pair into the BST


getServer

public jcsq.CSServer getServer(int index)
use for array-type access in the BST


getInfo

public jcsq.serverinfo.ServerInfo getInfo(int index)
use for array-type access in the BST


getServerArray

public jcsq.CSServer[] getServerArray()

getServerList

public java.util.ArrayList getServerList()

getInfoList

public java.util.ArrayList getInfoList()

getInfoArray

public jcsq.serverinfo.ServerInfo[] getInfoArray()

sortBy

public void sortBy(int sortMethod)
re-hash the servers, use values for sortMethod as the following: 1 - server name 2 - IP 3 - ping 4 - players connected 5 - max players 6 - mapname


lister

private void lister(CSServerTree.CSServerNode.CSServerNode point,
                    java.util.ArrayList list)

lister_i

private void lister_i(CSServerTree.CSServerNode.CSServerNode point,
                      java.util.ArrayList list)

addR

private void addR(CSServerTree.CSServerNode.CSServerNode point,
                  CSServerTree.CSServerNode.CSServerNode toAdd)

compare

private int compare(jcsq.CSServer server1,
                    jcsq.serverinfo.ServerInfo info1,
                    jcsq.CSServer server2,
                    jcsq.serverinfo.ServerInfo info2,
                    int compareType)