|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.lrc.LRCRegionStore
public class LRCRegionStore
This class maintains a list of all RegionInstance
instances known to the LRC.
RegionStore
maintains a set of cloned RegionInstance
s, as opposed to
storing direct references to the original RegionInstance
s. This way, when the instances
are changed by a Federate, the new values are not actually used until they notify the RTI
of the change.
NOTE: This class is NOT THREAD SAFE.
Field Summary | |
---|---|
private Map<Integer,RegionInstance> |
regions
|
Constructor Summary | |
---|---|
LRCRegionStore()
|
Method Summary | |
---|---|
void |
addRegion(RegionInstance region)
Adds the given RegionInstance to the store. |
boolean |
containsRegion(HLA13Region region)
Returns true if the store contains the given HLA13Region ,
false otherwise. |
boolean |
containsRegion(int regionHandle)
Returns true if the store contains a RegionInstance with the given
handle, false otherwise. |
boolean |
containsRegion(Java1Region region)
Returns true if the store contains the given Java1Region ,
false otherwise. |
boolean |
containsRegion(RegionInstance region)
Returns true if the store contains the given RegionInstance ,
false otherwise. |
RegionInstance |
getRegion(int regionHandle)
Fetch the contained region with the supplied region handle. |
RegionInstance |
removeRegion(int regionHandle)
Remove and return the contained RegionInstance with the given handle. |
RegionInstance |
removeRegion(RegionInstance theRegion)
Remove and return the contained RegionInstance . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Map<Integer,RegionInstance> regions
Constructor Detail |
---|
public LRCRegionStore()
Method Detail |
---|
public void addRegion(RegionInstance region)
RegionInstance
to the store. If there is already a
RegionInstance
with the given handle within this store, that RegionInstance
will be replaced with the one that is being added. If the given region is null, nothing
will happen.
NOTE: When adding a RegionInstance
, the actual source instance will not
be stored. Rather, the instance will be cloned, and the cloned instance stored.
public RegionInstance getRegion(int regionHandle)
RegionInstance
can be found with that handle, null
is returned.
NOTE: The returned instance will NOT be the actual stored instance. Rather, it
will be a clone of the stored instance. This way, changes made will not affect the original.
public RegionInstance removeRegion(int regionHandle)
RegionInstance
with the given handle. If the
RegionInstance
exists, it will be removed and returned. If no RegionInstance
with the given handle exists, null will be returned and the store will remain unaffected.
This will return the actual referenced instance, unlike the getRegion(int)
method,
which will return a clonse.
public RegionInstance removeRegion(RegionInstance theRegion)
RegionInstance
. If the RegionInstance
exists in the store, it will be removed and returned. If the RegionInstance
doesn't
exist in the collection, null will be returned and the store will remain unaffected.
This will return the actual referenced instance, unlike the getRegion(int)
method,
which will return a clonse.
public boolean containsRegion(int regionHandle)
true
if the store contains a RegionInstance
with the given
handle, false
otherwise.
public boolean containsRegion(RegionInstance region)
true
if the store contains the given RegionInstance
,
false
otherwise.
public boolean containsRegion(HLA13Region region)
true
if the store contains the given HLA13Region
,
false
otherwise. It will actually get the wrapped RegionInstance
instance inside the HLA13Region
and check using that.
public boolean containsRegion(Java1Region region)
true
if the store contains the given Java1Region
,
false
otherwise. It will actually get the wrapped RegionInstance
instance inside the Java1Region
and check using that.
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |