edu.sc.ants
Class Follower.BlackList

java.lang.Object
  |
  +--edu.sc.ants.Follower.BlackList

class Follower.BlackList
extends java.lang.Object

The list of all the agents a Follower agent cannot follow. We provide several helper functions for utilizing this list.


Inner Class Summary
(package private)  class Follower.BlackList.BlackListElement
          A small class to hold a blacklisted agent ID and the time we added this ID to the list.
 
Field Summary
(package private)  java.util.Vector list
          A list of blackListElement
 
Constructor Summary
Follower.BlackList()
          Constructor
 
Method Summary
 boolean addAgent(int id)
          Adds agent to the list.
 void expireOld(long miliseconds)
          Expire entries that are older than miliseconds.
 boolean isAgentIn(int id)
          Tells whether agent id is in the list or not.
 boolean isAgentInUpdate(int id)
          Tells whether agent id is in the list or not and, if it is in, updates its time to the current time.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

list

java.util.Vector list
A list of blackListElement
Constructor Detail

Follower.BlackList

public Follower.BlackList()
Constructor
Method Detail

addAgent

public boolean addAgent(int id)
Adds agent to the list. If the agent was already there we update its addition time and return true, if not we add it.
Returns:
true if id was in, false if not.

isAgentIn

public boolean isAgentIn(int id)
Tells whether agent id is in the list or not.
Returns:
whether agent id is in the list (true) or not (false).

isAgentInUpdate

public boolean isAgentInUpdate(int id)
Tells whether agent id is in the list or not and, if it is in, updates its time to the current time.
Returns:
whether agent id is in the list (true) or not (false).

expireOld

public void expireOld(long miliseconds)
Expire entries that are older than miliseconds.