Class Topology

java.lang.Object
ca.spatial.table.Topology

public class Topology extends Object
This class ecapsulates topological relationships between blocks. Each block has an associated Node object. Nodes contain a list of Edge objects that make connections to other Nodes.

Use this Topology class to find Nodes and through the Nodes find the Edges.

See Also:
Node, Edge
  • Constructor Details

    • Topology

      public Topology(ArrayList<Node> nodeList, Node space)
      Create a new topology structure from a populated node list. Assumne 1:1 mapping between nodes and rows.
  • Method Details

    • copy

      public Topology copy(double distance)
      Copy the topology structure
      Parameters:
      distance - set the maximum distance between polygons. Connections that have greater distances will be filtered out.
    • compare

      public boolean compare(Topology other)
    • getSpaceNode

      public Node getSpaceNode()
      Get the special Node that marks a block with a missing Node.
    • getSize

      public int getSize()
      Get the number of Nodes in the table
    • getNodes

      public Node[] getNodes()
      Get the entire array of Nodes
    • getNode

      public Node getNode(int index)
      Get the Node corresponding to the block index.
    • getNodeByLabel

      public Node getNodeByLabel(Object label)
      Get the Node corresponding to the block label
    • getRowForNode

      public int getRowForNode(int index)
    • getMaxDistance

      public double getMaxDistance()
      Get the maximum inter-neighbour distance used in this network.
    • getFilename

      public String getFilename()
      Get the filename that was used to create this topology object.
    • getStore

      public AttributeStore getStore()
      Get the AttributeStore object that this topology file matches up to.
    • setStore

      public void setStore(AttributeStore store)
      Get the AttributeStore object that this topology file matches up to.
    • getLabel

      public String getLabel()
      Get the column name from the attribuet store that contains the unique row label.
    • selectNeighbours

      public BitSet selectNeighbours(BitSet in, double distance)
      Return a BitSet that contains all neightbours of the selections in the input set.
      Parameters:
      in - a BitSet that has the index values of the nodes of interest set
      distance - the maximum separation distance to select
      Returns:
      a BitSet with values set for all of the neighbour nodes to the input selection.
    • symmetry

      public boolean symmetry()
      Due to the way the data is loaded this test will always succeed.
    • inputTopology

      public static Topology inputTopology(File file, double distance, Task task, Map<String,​int[]> sizeLu, AttributeStore store, String label)
    • toString

      public String toString()
      Overrides:
      toString in class Object