CopyOnWriteArrayList<Entity> entities = new CopyOnWriteArrayList<Entity>(); public void deleteEntities() { for(Entity entity: entities){ Body body = entity.getBody(); if (body != null) { EntityData data = (EntityData) body.getUserData(); if (data.isFlaggedForDelete()) { final Array<JointEdge> list = body.getJointList(); //delete all joints attached while (list.size > 0) { myWorld.getWorld().destroyJoint(list.get(0).joint); } //nullify everything, remove the entity from entities and destroy the body body.setUserData(null); myWorld.getWorld().destroyBody(body); entities.remove(entity); body = null; } } } }
/** * Constructor for the <code>RequestEntity</code> object. This is * used to create a request that contains all the parts sent by * the client, including the headers and the request body. Each of * the request elements are accessible through this object in a * convenient manner, all parts and parameters, as well as cookies * can be accessed and used without much effort. * * @param observer this is the observer used to monitor events * @param entity this is the entity that was sent by the client */ public RequestEntity(ResponseObserver observer, Entity entity) { this.certificate = new RequestCertificate(observer, entity); this.builder = new QueryBuilder(this, entity); this.channel = entity.getChannel(); this.header = entity.getHeader(); this.body = entity.getBody(); this.time = entity.getTime(); }
/** * Constructor for the <code>RequestEntity</code> object. This is * used to create a request that contains all the parts sent by * the client, including the headers and the request body. Each of * the request elements are accessible through this object in a * convenient manner, all parts and parameters, as well as cookies * can be accessed and used without much effort. * * @param entity this is the entity that was sent by the client * @param monitor this is the monitor used to monitor events */ public RequestEntity(Entity entity, Monitor monitor) { this.certificate = new RequestCertificate(entity, monitor); this.builder = new QueryBuilder(this, entity); this.channel = entity.getChannel(); this.header = entity.getHeader(); this.body = entity.getBody(); this.time = entity.getTime(); }
/** * Constructor for the <code>RequestEntity</code> object. This is * used to create a request that contains all the parts sent by * the client, including the headers and the request body. Each of * the request elements are accessible through this object in a * convenient manner, all parts and parameters, as well as cookies * can be accessed and used without much effort. * * @param observer this is the observer used to monitor events * @param entity this is the entity that was sent by the client */ public RequestEntity(ResponseObserver observer, Entity entity) { this.certificate = new RequestCertificate(observer, entity); this.builder = new QueryBuilder(this, entity); this.channel = entity.getChannel(); this.header = entity.getHeader(); this.body = entity.getBody(); this.time = entity.getTime(); }