proper.remote
Class ClientList

java.lang.Object
  extended by proper.remote.ClientList

public class ClientList
extends java.lang.Object

This class manages a list of clients.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
ClientList()
          initializes the object
 
Method Summary
 void add(java.net.InetSocketAddress client)
          adds the given client to the list
 void add(java.net.InetSocketAddress client, java.lang.String job)
          adds the given client with its job to the list
 boolean contains(java.net.InetSocketAddress client)
          checks whether the given client is already in the list
 java.net.InetSocketAddress get(int index)
          returns the specified client, NULL if index is out of bounds
 java.lang.String getJob(int index)
          returns the job of a specified client, NULL if index is out of bounds
 int indexOf(java.net.InetSocketAddress client)
          returns the index of the given client in the list
 java.net.InetSocketAddress peek()
          takes a look at the topmost client on the stack, can be NULL
 java.net.InetSocketAddress peekJob()
          takes a look at the topmost job on the stack, can be NULL
 java.net.InetSocketAddress pop()
          returns the current topmost client from the list (like from a stack), it also removes the associated job
 void push(java.net.InetSocketAddress client)
          adds the given client to the list (like on a stack)
 void push(java.net.InetSocketAddress client, java.lang.String job)
          adds the given client and its job to the list (like on a stack)
 java.net.InetSocketAddress remove(java.net.InetSocketAddress client)
          removes the specified client (and its job) from the list
 java.net.InetSocketAddress remove(int index)
          removes the specified client (and its job) from the list
 int size()
          the number of clients currently in the list
 java.lang.String toString()
          the list in a string representation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientList

public ClientList()
initializes the object

Method Detail

size

public int size()
the number of clients currently in the list


get

public java.net.InetSocketAddress get(int index)
returns the specified client, NULL if index is out of bounds


getJob

public java.lang.String getJob(int index)
returns the job of a specified client, NULL if index is out of bounds


contains

public boolean contains(java.net.InetSocketAddress client)
checks whether the given client is already in the list


indexOf

public int indexOf(java.net.InetSocketAddress client)
returns the index of the given client in the list


add

public void add(java.net.InetSocketAddress client)
adds the given client to the list


add

public void add(java.net.InetSocketAddress client,
                java.lang.String job)
adds the given client with its job to the list


remove

public java.net.InetSocketAddress remove(int index)
removes the specified client (and its job) from the list


remove

public java.net.InetSocketAddress remove(java.net.InetSocketAddress client)
removes the specified client (and its job) from the list


push

public void push(java.net.InetSocketAddress client)
adds the given client to the list (like on a stack)


push

public void push(java.net.InetSocketAddress client,
                 java.lang.String job)
adds the given client and its job to the list (like on a stack)


pop

public java.net.InetSocketAddress pop()
returns the current topmost client from the list (like from a stack), it also removes the associated job


peek

public java.net.InetSocketAddress peek()
takes a look at the topmost client on the stack, can be NULL


peekJob

public java.net.InetSocketAddress peekJob()
takes a look at the topmost job on the stack, can be NULL


toString

public java.lang.String toString()
the list in a string representation

Overrides:
toString in class java.lang.Object