com.asdf.utils
Class Filter

java.lang.Object
  extended by com.asdf.utils.Filter

public class Filter
extends java.lang.Object

Used by lobby to filter game lists. Filter is set filter rules and these rules are then checked when game list is drawn.

Author:
asdf

Constructor Summary
Filter()
           
 
Method Summary
 boolean hideEmpty()
          Checks if empty games are hidden.
 boolean hideFull()
          Checks if full games are hidden.
 boolean nameContains(java.lang.String name)
          Checks if name contains set name filter String.
 boolean players(int players)
          Checks if player amount is within the bounds of this filter.
 void setHideEmpty(boolean b)
          Sets filter rule.
 void setHideFull(boolean b)
          Sets filter rule.
 void setNameContains(java.lang.String s)
          Sets name filter rule.
 void setPlayers(int min, int max)
          Sets player amount filter rule.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter()
Method Detail

setNameContains

public void setNameContains(java.lang.String s)
Sets name filter rule.

Parameters:
s - String to be used to filter game names.

setHideFull

public void setHideFull(boolean b)
Sets filter rule.

Parameters:
b -

setHideEmpty

public void setHideEmpty(boolean b)
Sets filter rule.

Parameters:
b -

hideFull

public boolean hideFull()
Checks if full games are hidden.


hideEmpty

public boolean hideEmpty()
Checks if empty games are hidden.


nameContains

public boolean nameContains(java.lang.String name)
Checks if name contains set name filter String.

Parameters:
name - String to be checked.
Returns:
true if passes filter, false if not.

setPlayers

public void setPlayers(int min,
                       int max)
Sets player amount filter rule.

Parameters:
min - Minimum players.
max - Maximum players.

players

public boolean players(int players)
Checks if player amount is within the bounds of this filter.

Parameters:
players - Amount of players.
Returns:
is within the bounds