net.phys2d.raw
Class BodyList

java.lang.Object
  extended bynet.phys2d.raw.BodyList
Direct Known Subclasses:
QuadSpaceStrategy.Space

public class BodyList
extends java.lang.Object

A typed list of Body


Constructor Summary
BodyList()
          Create an empty list
 
Method Summary
 void add(Body body)
          Add a body to the list
 void clear()
          Clear all the elements out of the list
 boolean contains(Body body)
          Check if this list contains the specified body
 Body get(int i)
          Get a body at a specific index
 BodyList getContentsExcluding(BodyList others)
          Get a list of bodies containing all of the bodies in this list except those specified
 void remove(Body body)
          Remove a body from the list
 int size()
          Get the number of elements in the list
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BodyList

public BodyList()
Create an empty list

Method Detail

add

public void add(Body body)
Add a body to the list

Parameters:
body - The body to add

size

public int size()
Get the number of elements in the list

Returns:
The number of the element in the list

remove

public void remove(Body body)
Remove a body from the list

Parameters:
body - The body to remove from the list

get

public Body get(int i)
Get a body at a specific index

Parameters:
i - The index of the body to retrieve
Returns:
The body retrieved

clear

public void clear()
Clear all the elements out of the list


contains

public boolean contains(Body body)
Check if this list contains the specified body

Parameters:
body - The body to look for
Returns:
True if this list contains the specified body

getContentsExcluding

public BodyList getContentsExcluding(BodyList others)
Get a list of bodies containing all of the bodies in this list except those specified

Parameters:
others - The bodies that should be removed from the contents
Returns:
The list of bodies excluding those specified

toString

public java.lang.String toString()
See Also:
Object.toString()