org.nlogo.agent
Class ArrayAgentSet

java.lang.Object
  extended by org.nlogo.agent.AgentSet
      extended by org.nlogo.agent.ArrayAgentSet
All Implemented Interfaces:
AgentSet

public final class ArrayAgentSet
extends AgentSet


Nested Class Summary
 class ArrayAgentSet.Iterator
           
 
Constructor Summary
ArrayAgentSet(Class<? extends Agent> type, Agent[] agents, String printName, World world)
           
ArrayAgentSet(Class<? extends Agent> type, Agent[] agents, World world)
           
ArrayAgentSet(Class<? extends Agent> type, int initialCapacity, boolean removableAgents, World world)
           
 
Method Summary
 void add(Agent agent)
           
 Agent agent(long i)
           
 boolean contains(Agent agent)
           
 int count()
          Returns the number of agents in the set
 boolean isEmpty()
           
 AgentSet.Iterator iterator()
           
 Agent randomOne(int precomputedCount, int random)
           
 AgentSet.Iterator shufflerator(org.nlogo.util.MersenneTwisterFast random)
           
 Agent[] toArray()
           
 LogoList toLogoList()
           
 String toString()
           
 
Methods inherited from class org.nlogo.agent.AgentSet
agents, clearDirected, equalAgentSets, getAgentBit, isDirected, isUndirected, printName, randomSubset, setDirected, type, world
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayAgentSet

public ArrayAgentSet(Class<? extends Agent> type,
                     int initialCapacity,
                     boolean removableAgents,
                     World world)

ArrayAgentSet

public ArrayAgentSet(Class<? extends Agent> type,
                     Agent[] agents,
                     World world)

ArrayAgentSet

public ArrayAgentSet(Class<? extends Agent> type,
                     Agent[] agents,
                     String printName,
                     World world)
Method Detail

count

public int count()
Description copied from interface: AgentSet
Returns the number of agents in the set

Specified by:
count in interface AgentSet
Specified by:
count in class AgentSet

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in class AgentSet

agent

public Agent agent(long i)
Specified by:
agent in class AgentSet

add

public void add(Agent agent)
Specified by:
add in class AgentSet

contains

public boolean contains(Agent agent)
Specified by:
contains in class AgentSet

randomOne

public Agent randomOne(int precomputedCount,
                       int random)
Specified by:
randomOne in class AgentSet

toLogoList

public LogoList toLogoList()
Specified by:
toLogoList in class AgentSet

toArray

public Agent[] toArray()
Specified by:
toArray in class AgentSet

toString

public String toString()
Overrides:
toString in class Object

iterator

public AgentSet.Iterator iterator()
Specified by:
iterator in class AgentSet

shufflerator

public AgentSet.Iterator shufflerator(org.nlogo.util.MersenneTwisterFast random)
Specified by:
shufflerator in class AgentSet