Package uk.ac.starlink.ttools.plot2.geom
Enum MatrixFormat
- All Implemented Interfaces:
Serializable
,Comparable<MatrixFormat>
,java.lang.constant.Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns a user-directed description of this format.getShape
(int nw, boolean hasOnDiag, boolean hasOffDiag) Returns a MatrixShape for a matrix of a given size conforming to this MatrixFormat.Indicates whether to include the diagonal cells.hasLower()
Indicates whether to include the lower triangular cells.hasUpper()
Indicates whether to include the upper triangular cells.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.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.static MatrixFormat
Returns the enum constant of this type with the specified name.static MatrixFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
LOWER
Lower diagonal part of matrix is occupied. -
UPPER
Upper diagonal part of matrix is occupied. -
FULL
Full matrix is occupied.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
hasDiagonal
Indicates whether to include the diagonal cells.- Returns:
- diagonal cells included/excluded/automatic
-
hasLower
Indicates whether to include the lower triangular cells.- Returns:
- lower triangular cells included/excluded/automatic
-
hasUpper
Indicates whether to include the upper triangular cells.- Returns:
- upper triangular cells included/excluded/automatic
-
getDescription
Returns a user-directed description of this format.- Returns:
- description
-
getShape
Returns a MatrixShape for a matrix of a given size conforming to this MatrixFormat.- Parameters:
nw
- linear dimension of the matrixhasOnDiag
- whether on-diagonal cells are presenthasOffDiag
- whether off-diagonal cells are present- Returns:
- matrix shape
- See Also:
-
isOnDiagonal
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
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
-