Package ghidra.graph.viewer.layout
Class Row<V>
- java.lang.Object
-
- ghidra.graph.viewer.layout.Row<V>
-
public class Row<V> extends java.lang.Object
A row in a grid. This class stores its row index, its y offset and its height. The y value is the layout space y value of aPoint2D
object. That is, unlike theGridLocationMap
, the y value of this object is in layout space and not indexes of a grid.This class maintains a collection of vertices on this row, organized by column index. You can get the column of a vertex from
#getColumn(V)
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumn(V v)
Returns the column index for the given vertexint
getColumnCount()
Represents the range of columns in this row.int
getEndColumn()
Returns the largest column index in this rowint
getPaddedHeight(boolean isCondensed)
java.lang.Integer
getStartColumn()
Returns the smallest column index in this rowV
getVertex(int column)
Returns the vertex at the given column index or null if there is no vertex at that columnjava.util.List<V>
getVertices()
Returns all vertices in this row, sorted by column index (min to max).boolean
isInitialized()
void
setColumn(V v, int col)
Sets the column index in this row for the given vertexjava.lang.String
toString()
-
-
-
Method Detail
-
setColumn
public void setColumn(V v, int col)
Sets the column index in this row for the given vertex- Parameters:
v
- the vertexcol
- the column index
-
getColumn
public int getColumn(V v)
Returns the column index for the given vertex- Parameters:
v
- the vertex- Returns:
- the column index for the given vertex
-
getVertex
public V getVertex(int column)
Returns the vertex at the given column index or null if there is no vertex at that column- Parameters:
column
- the column index- Returns:
- the vertex
-
getColumnCount
public int getColumnCount()
Represents the range of columns in this row. For this given row in a grid:0 1 2 3 4 5 6 - - v - v - -
the column count is 3--where the column range is 2-4, inclusive.Note: this differs from then number of vertices in this row, as the column count includes columns that have no vertex.
- Returns:
- the number of columns in this row, including empty columns between start and end
-
getStartColumn
public java.lang.Integer getStartColumn()
Returns the smallest column index in this row- Returns:
- the smallest column index in this row
-
getEndColumn
public int getEndColumn()
Returns the largest column index in this row- Returns:
- the largest column index in this row
-
getVertices
public java.util.List<V> getVertices()
Returns all vertices in this row, sorted by column index (min to max).Note: the index of a vertex in the list does not match the column index. To get the column index for a vertex, call
#getColumn(V)
.- Returns:
- all vertices in this row
-
getPaddedHeight
public int getPaddedHeight(boolean isCondensed)
-
isInitialized
public boolean isInitialized()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-