Atavism Version 2018.1AGIS API

atavism.server.engine
Class QuadTree.NewsAndFrees

java.lang.Object
  extended by atavism.server.engine.QuadTree.NewsAndFrees
Enclosing class:
QuadTree<ElementType extends QuadTreeElement<ElementType>>

public class QuadTree.NewsAndFrees
extends java.lang.Object

Instances of this class are used to accumulate news and frees of objects, from the point of view of perceivers, so that we can perform the new and free operations, which generate messages, without holding the top-level quad tree lock.


Field Summary
protected  java.util.Map<Perceiver<ElementType>,PerceiverNewsAndFrees<ElementType>> perceiverMap
           
 
Constructor Summary
QuadTree.NewsAndFrees()
           
 
Method Summary
 java.util.Map<Perceiver<ElementType>,PerceiverNewsAndFrees<ElementType>> getMap()
           
 void noteFreedElement(Perceiver<ElementType> perceiver, ElementType element)
          If the perceiver says the element should be a freed element, add it to the freedElements list
 void noteNewElement(Perceiver<ElementType> perceiver, ElementType element)
          If the perceiver says the element should be a new element, add it to the newElements list for the perceiver
protected  java.lang.Integer processBatchedNewsAndFrees(OID mobilePerceiverOid)
          If the perceiverOid is non-null, the count returned is the count of the number of news plus number of frees for the perceiver identified by perceiverOid
 java.lang.Integer processNewsAndFrees()
           
 java.lang.Integer processNewsAndFrees(OID mobilePerceiverOid)
          Either process all news and frees in a single change subscription message, or process them one-by-one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

perceiverMap

protected java.util.Map<Perceiver<ElementType extends QuadTreeElement<ElementType>>,PerceiverNewsAndFrees<ElementType extends QuadTreeElement<ElementType>>> perceiverMap
Constructor Detail

QuadTree.NewsAndFrees

public QuadTree.NewsAndFrees()
Method Detail

getMap

public java.util.Map<Perceiver<ElementType>,PerceiverNewsAndFrees<ElementType>> getMap()

noteNewElement

public void noteNewElement(Perceiver<ElementType> perceiver,
                           ElementType element)
If the perceiver says the element should be a new element, add it to the newElements list for the perceiver


noteFreedElement

public void noteFreedElement(Perceiver<ElementType> perceiver,
                             ElementType element)
If the perceiver says the element should be a freed element, add it to the freedElements list


processNewsAndFrees

public java.lang.Integer processNewsAndFrees()

processNewsAndFrees

public java.lang.Integer processNewsAndFrees(OID mobilePerceiverOid)
Either process all news and frees in a single change subscription message, or process them one-by-one.


processBatchedNewsAndFrees

protected java.lang.Integer processBatchedNewsAndFrees(OID mobilePerceiverOid)
If the perceiverOid is non-null, the count returned is the count of the number of news plus number of frees for the perceiver identified by perceiverOid



Copyright © 2018 Dragonsan Studios Sp. z o.o.