Enum MatrixFormat

java.lang.Object
java.lang.Enum<MatrixFormat>
uk.ac.starlink.ttools.plot2.geom.MatrixFormat
All Implemented Interfaces:
Serializable, Comparable<MatrixFormat>, java.lang.constant.Constable

public enum MatrixFormat extends Enum<MatrixFormat>
Defines which cells from a matrix are included.

The various parts are specified by Boolean wrapper types; TRUE/FALSE value indicates unconditional in/exclusion, and a null value will include those cells only if there is something to plot in there.

Since:
16 Aug 2023
Author:
Mark Taylor
  • Enum Constant Details

    • LOWER

      public static final MatrixFormat LOWER
      Lower diagonal part of matrix is occupied.
    • UPPER

      public static final MatrixFormat UPPER
      Upper diagonal part of matrix is occupied.
    • FULL

      public static final MatrixFormat FULL
      Full matrix is occupied.
  • Method Details

    • values

      public static MatrixFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static MatrixFormat valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • hasDiagonal

      public Boolean hasDiagonal()
      Indicates whether to include the diagonal cells.
      Returns:
      diagonal cells included/excluded/automatic
    • hasLower

      public Boolean hasLower()
      Indicates whether to include the lower triangular cells.
      Returns:
      lower triangular cells included/excluded/automatic
    • hasUpper

      public Boolean hasUpper()
      Indicates whether to include the upper triangular cells.
      Returns:
      upper triangular cells included/excluded/automatic
    • getDescription

      public String getDescription()
      Returns a user-directed description of this format.
      Returns:
      description
    • getShape

      public MatrixShape getShape(int nw, boolean hasOnDiag, boolean hasOffDiag)
      Returns a MatrixShape for a matrix of a given size conforming to this MatrixFormat.
      Parameters:
      nw - linear dimension of the matrix
      hasOnDiag - whether on-diagonal cells are present
      hasOffDiag - whether off-diagonal cells are present
      Returns:
      matrix shape
      See Also:
    • isOnDiagonal

      public static boolean isOnDiagonal(CoordGroup cgrp)
      Indicates whether a given coordinate group represents a grid element that would appear on the diagonal of a matrix plot. This will return true if the coord group has one spatial coordinate, that is if it's histogram-like.
      Parameters:
      cgrp - coord group
      Returns:
      true for on-diagonal matrix plot element
    • isOffDiagonal

      public static boolean isOffDiagonal(CoordGroup cgrp)
      Indicates whether a given coordinate group represents a grid element that would appear off the diagonal of a matrix plot. This will return true if the coord group has two spatial coordinates, that is if it's scatter-plot-like.
      Parameters:
      cgrp - coord group, assumed to be the sort of coords that might show up in a matrix plot
      Returns:
      true for off-diagonal matrix plot element