|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ascape.model.space.CollectionSpace
org.ascape.model.space.Discrete
org.ascape.model.space.Array
org.ascape.model.space.ListBase
org.ascape.model.space.ListSpace
org.ascape.model.space.SubListSpace
public class SubListSpace
A space list that is part of another space list. Any agents added to this list will also be added to the super list, and any agents removed from this list will be removed from the super list. Note that agents removed directly from the super list will not be removed from this list.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.ascape.model.space.CollectionSpace |
---|
CollectionSpace.ClosestDataPoint, CollectionSpace.ConditionalIterator, CollectionSpace.CSIterator, CollectionSpace.CSMutableIterator, CollectionSpace.ListMutableRandomIterator, CollectionSpace.ListRandomIterator, CollectionSpace.MutableSubIterator, CollectionSpace.SubIterator |
Field Summary |
---|
Fields inherited from class org.ascape.model.space.Array |
---|
CACHE_RESULTS |
Fields inherited from class org.ascape.model.space.Discrete |
---|
performanceWarning |
Fields inherited from class org.ascape.model.space.CollectionSpace |
---|
collection, ESTIMATED_MAXIMUM_SIZE, extent, geometry |
Constructor Summary | |
---|---|
SubListSpace()
Constructs a sub-list list. |
|
SubListSpace(CoordinateDiscrete extent)
Constructs a sub-list list. |
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object o,
boolean isParent)
Adds the supplied object (agent) to this list at the specified location and to end of the super list. |
boolean |
add(java.lang.Object o,
boolean isParent)
Adds the supplied object (agent) to this list at the specified location and to end of the super list. |
boolean |
addAll(java.util.Collection c)
Inserts all of the agents in the specified collection at the location specified in this list, and at the end of the super list. |
boolean |
addAll(int index,
java.util.Collection c)
Inserts all of the agents in the specified collection at the location specified in this list, and at the end of the super list. |
protected void |
addToSuper(int index,
java.lang.Object o,
boolean isParent)
Adds the to super. |
double |
calculateDistance(Coordinate origin,
Coordinate target)
Returns the shortest distance between one agent and the other, in the context of the superscape. |
void |
clear()
Removes all agents from the space, and all members of this space from the super list. |
Space |
getSuperSpace()
Returns the super list for this sub list, that is, the list defined to contain a superset of this space's agents. |
void |
moveAway(Location origin,
Coordinate target,
double distance)
Moves an agent toward the specified agent in the context of the superscape. |
void |
moveToward(Location origin,
Coordinate target,
double distance)
Moves an agent toward the specified agent in the context of the superscape. |
void |
populate()
Populates the space and its super list with clones of the prototype agent. |
boolean |
remove(java.lang.Object o)
Removes the supplied object (agent) from this list and its superlist. |
boolean |
removeAll(java.util.Collection c)
Removes all of the agnets contained in the collection from this space list and its super space list. |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in the space that are in the specified collection. |
void |
setSuperSpace(Space superSpace)
Sets the super list for this sub list, that is, the list defined to contain a superset of this space's agents. |
Methods inherited from class org.ascape.model.space.ListBase |
---|
add, add, coordinateSweep, findCellAway, findCellToward, findFirstMatchInRank, findNearestMatchRank, findNearestMatchRank, findRandomMatchInRank, findWithinImpl, get, get, indexOf, isCoordinateSweepNeeded, lastIndexOf, listIterator, listIterator, remove, remove, set, set, setGeometry, subList |
Methods inherited from class org.ascape.model.space.Array |
---|
findNearest, findWithin, replace, swap |
Methods inherited from class org.ascape.model.space.CollectionSpace |
---|
add, calculateDistance, clone, conditionalIterator, conditionalIterator, construct, contains, containsAll, countWithin, createOrder, createSpatialConditional, deleteSweep, filter, find, findMaximum, findMaximum, findMaximumWithin, findMinimum, findMinimum, findMinimumWithin, findNearest, findRandom, findRandom, findRandom, findRandom, findRandomCoordinate, findRandomWithin, get, getContext, getExtent, getGeometry, getRandom, hasWithin, initialize, isDeleteSweepNeeded, isEmpty, isMutable, isPeriodic, iterator, iteratorCount, iteratorToList, newLocation, newLocation, randomInRange, randomInRange, randomIs, randomizeOrder, randomToLimit, safeIterator, safeIterator, safeIterators, safeRandomIterator, set, setContext, setExtent, setExtent, setPeriodic, setRandom, setSize, size, toArray, toArray, toList, withinIterator |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ascape.model.space.CoordinateMutable |
---|
coordinateSweep, isCoordinateSweepNeeded |
Methods inherited from interface java.util.List |
---|
add, contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray |
Constructor Detail |
---|
public SubListSpace()
public SubListSpace(CoordinateDiscrete extent)
extent
- a coordinate describing the size of this spaceMethod Detail |
---|
public void populate()
populate
in interface Space
populate
in class ListBase
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in interface Mutable
remove
in class ListBase
o
- the agent to be removed
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class ListBase
index
- the location at which to place the agentsc
- collection whose agents are to be added to the space
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class CollectionSpace
c
- collection whose agents are to be added to the space
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class CollectionSpace
c
- collection whose agents are to be added to the space
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class CollectionSpace
c
- collection whose agents are to be retained in the space
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in interface Mutable
clear
in class CollectionSpace
protected void addToSuper(int index, java.lang.Object o, boolean isParent)
index
- the indexo
- the oisParent
- the is parentpublic boolean add(java.lang.Object o, boolean isParent)
add
in interface Space
add
in class ListBase
o
- the agent to addisParent
- should this space be made the parent space of the agent?
java.lang.ClassCastException
- if the object is not an instance of agentpublic void add(int index, java.lang.Object o, boolean isParent)
add
in class ListBase
index
- location to insert the new agento
- the agent to addisParent
- should this space be made the parent space of the agent?
java.lang.ClassCastException
- if the object is not an instance of agentpublic Space getSuperSpace()
getSuperSpace
in interface SubSpace
public void setSuperSpace(Space superSpace)
setSuperSpace
in interface SubSpace
superSpace
- the list to assign as super setpublic void moveToward(Location origin, Coordinate target, double distance)
moveToward
in interface Space
moveToward
in class CollectionSpace
origin
- the agent movingtarget
- the agent's targetdistance
- the distance to movepublic void moveAway(Location origin, Coordinate target, double distance)
moveAway
in interface Space
moveAway
in class CollectionSpace
origin
- the agent movingtarget
- the agent's targetdistance
- the distance to movepublic double calculateDistance(Coordinate origin, Coordinate target)
calculateDistance
in interface Space
calculateDistance
in class ListBase
origin
- the starting celltarget
- the ending cell
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |