implement abstract class for metric types.