All Packages Class Hierarchy This Package Previous Next Index
Class benno.submerge.Zone
java.lang.Object
|
+----benno.submerge.Zone
- public class Zone
- extends Object
- implements Serializable
This is a zone of allocation.
It consists of a list of networks provided by an upstream entities
and then a list of allocations to downstream entities
-
Zone(String)
-
-
addDownstream(Network)
- allocates network n in the downstream network.
-
addUpstream(Network)
-
-
countFree(int)
- counts the free networks with a mask length of 'bits'
-
findFree(int)
- Locates a free network with 'bits' network bits.
-
numAddrs()
- sums the numAddrs for all of the upstream networks
-
optimiseFreestream()
- This scans the freestream vector merging adjacent networks into
supernets.
-
toString()
-
Zone
public Zone(String s)
toString
public String toString()
- Overrides:
- toString in class Object
addUpstream
public void addUpstream(Network n)
addDownstream
public void addDownstream(Network n)
- allocates network n in the downstream network. As necessary, it
splits up networks in the freestream to do this.
numAddrs
public int numAddrs()
- sums the numAddrs for all of the upstream networks
countFree
public int countFree(int bits)
- counts the free networks with a mask length of 'bits'
findFree
public Network findFree(int bits)
- Locates a free network with 'bits' network bits.
Works by looking at all subnets of each upstream network, and testing
to see if any downstream networks intersect.
optimiseFreestream
public void optimiseFreestream()
- This scans the freestream vector merging adjacent networks into
supernets.
The algorithm is:
for each network in the freestream:
check for the existence of a network with the last network bit
flipped.
if exists, replace both networks by a supernet 1-bit larger.
All Packages Class Hierarchy This Package Previous Next Index