getFundamentalTypeDimension function
PIComposer APIPIComposer API

getFundamentalTypeDimension#

int getFundamentalTypeDimension(FundamentalType fun)

Gets the dimensionality of a FundamentalType.

Returns the number of dimensions for collection types:

  • Returns 0 for non-collection (singular) types
  • Returns 1 for one-dimensional collections (arrays, lists)
  • Returns 2 for two-dimensional collections (arrays of arrays)
  • Returns 3 for three-dimensional collections

This implementation relies on the specific ordering of values in the FundamentalType enumeration, where collection types are grouped by their dimensionality.

Example:

getFundamentalTypeDimension(FundamentalType.STRING);   // 0
getFundamentalTypeDimension(FundamentalType.STRINGS);  // 1
getFundamentalTypeDimension(FundamentalType.STRINGS2); // 2
getFundamentalTypeDimension(FundamentalType.STRINGS3); // 3