Class DimensionsChecker

Object
DimensionsChecker

public class DimensionsChecker extends Object
Utility class for checking and ensuring consistency of dimensions across channels and masks.
  • Method Details

    • check

      public static void check(Channel channel, Mask mask) throws ProvisionFailedException
      Checks if a channel and a mask have the same dimensions.
      Parameters:
      channel - the Channel to check
      mask - the Mask to check against
      Throws:
      ProvisionFailedException - if the dimensions do not match
    • check

      public static void check(Channel channelToCheck, String channelToCheckName, Dimensions dimFromChannel) throws ProvisionFailedException
      Checks a channel to make sure it's the same size as an existing channel.
      Parameters:
      channelToCheck - the Channel whose size will be compared
      channelToCheckName - a user-meaningful string to identify the channelToCheck in error messages
      dimFromChannel - the Dimensions it must equal from channel (identified as channel in error messages)
      Throws:
      ProvisionFailedException - if the dimensions do not match
    • check

      public static void check(Mask maskToCheck, String channelToCheckName, Dimensions dimensionsFromChannel) throws ProvisionFailedException
      Checks a mask to make sure it's the same size as an existing channel.
      Parameters:
      maskToCheck - the Mask whose size will be compared
      channelToCheckName - a user-meaningful string to identify the channelToCheck in error messages
      dimensionsFromChannel - the Dimensions it must equal from channel (identified as channel in error messages)
      Throws:
      ProvisionFailedException - if the dimensions do not match
    • createSameSize

      public static Channel createSameSize(ChannelProvider provider, String providerName, Channel channelSameSize) throws ProvisionFailedException
      Creates a new channel from a provider, making sure it's the same size as an existing channel.
      Parameters:
      provider - the ChannelProvider to create the channel
      providerName - a user-meaningful string to identify the provider in error messages
      channelSameSize - the Channel which it must be the same size as (referred to in error messages as "channel")
      Returns:
      the newly created Channel
      Throws:
      ProvisionFailedException - if the dimensions do not match or channel creation fails
    • createSameSize

      public static Mask createSameSize(MaskProvider provider, String providerName, Channel channelSameSize) throws ProvisionFailedException
      Creates a new mask from a provider, making sure it's the same size as an existing channel.
      Parameters:
      provider - the MaskProvider to create the mask
      providerName - a user-meaningful string to identify the provider in error messages
      channelSameSize - the Channel which it must be the same size as (referred to in error messages as "channel")
      Returns:
      the newly created Mask
      Throws:
      ProvisionFailedException - if the dimensions do not match or mask creation fails