style: enable HideUtilityClassConstructor in checkstyle (#5147)

This commit is contained in:
Piotr Idzik
2024-05-08 08:58:29 +02:00
committed by GitHub
parent 030bb91d05
commit d3bb691f59
285 changed files with 895 additions and 339 deletions

View File

@ -13,7 +13,9 @@ import java.util.Scanner;
* @author Michael Rolland
* @version 2017.10.10
*/
public class AnyBaseToAnyBase {
public final class AnyBaseToAnyBase {
private AnyBaseToAnyBase() {
}
/**
* Smallest and largest base you want to accept as valid input

View File

@ -4,7 +4,9 @@ package com.thealgorithms.conversions;
* @author Varun Upadhyay (<a href="https://github.com/varunu28">...</a>)
*/
// Driver program
public class AnyBaseToDecimal {
public final class AnyBaseToDecimal {
private AnyBaseToDecimal() {
}
public static void main(String[] args) {
assert convertToDecimal("1010", 2) == Integer.valueOf("1010", 2);

View File

@ -6,7 +6,9 @@ import java.util.Scanner;
// number.
// sn ,sb,db ---> ()dn . this is what we have to do .
public class AnytoAny {
public final class AnytoAny {
private AnytoAny() {
}
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);

View File

@ -5,7 +5,9 @@ import java.util.Scanner;
/**
* This class converts a Binary number to a Decimal number
*/
class BinaryToDecimal {
final class BinaryToDecimal {
private BinaryToDecimal() {
}
public static long binaryToDecimal(long binNum) {
long binCopy, d, s = 0, power = 0;

View File

@ -8,7 +8,9 @@ import java.util.Scanner;
*
* @author Nishita Aggarwal
*/
public class BinaryToHexadecimal {
public final class BinaryToHexadecimal {
private BinaryToHexadecimal() {
}
/**
* This method converts a binary number to a hexadecimal number.

View File

@ -7,7 +7,9 @@ import java.util.Scanner;
*
* @author Zachary Jones
*/
public class BinaryToOctal {
public final class BinaryToOctal {
private BinaryToOctal() {
}
/**
* Main method

View File

@ -8,7 +8,9 @@ import java.util.ArrayList;
* @author Varun Upadhyay (<a href="https://github.com/varunu28">...</a>)
*/
// Driver Program
public class DecimalToAnyBase {
public final class DecimalToAnyBase {
private DecimalToAnyBase() {
}
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

View File

@ -5,7 +5,9 @@ import java.util.Scanner;
/**
* This class converts a Decimal number to a Binary number
*/
class DecimalToBinary {
final class DecimalToBinary {
private DecimalToBinary() {
}
/**
* Main Method

View File

@ -1,7 +1,9 @@
package com.thealgorithms.conversions;
// hex = [0 - 9] -> [A - F]
class DecimalToHexaDecimal {
final class DecimalToHexaDecimal {
private DecimalToHexaDecimal() {
}
private static final int SIZE_OF_INT_IN_HALF_BYTES = 8;
private static final int NUMBER_OF_BITS_IN_HALF_BYTE = 4;

View File

@ -5,7 +5,9 @@ import java.util.Scanner;
/**
* This class converts Decimal numbers to Octal Numbers
*/
public class DecimalToOctal {
public final class DecimalToOctal {
private DecimalToOctal() {
}
/**
* Main Method

View File

@ -7,7 +7,9 @@ import java.util.Scanner;
*
* @author Tanmay Joshi
*/
public class HexToOct {
public final class HexToOct {
private HexToOct() {
}
/**
* This method converts a Hexadecimal number to a decimal number

View File

@ -2,7 +2,9 @@ package com.thealgorithms.conversions;
import java.util.Scanner;
public class HexaDecimalToDecimal {
public final class HexaDecimalToDecimal {
private HexaDecimalToDecimal() {
}
// convert hexadecimal to decimal
public static int getHexaToDec(String hex) {

View File

@ -7,7 +7,9 @@ package com.thealgorithms.conversions;
* ('I', 1); ('IV',4); ('V', 5); ('IX',9); ('X', 10); ('XL',40); ('L', 50);
* ('XC',90); ('C', 100); ('D', 500); ('M', 1000);
*/
public class IntegerToRoman {
public final class IntegerToRoman {
private IntegerToRoman() {
}
private static final int[] ALL_ROMAN_NUMBERS_IN_ARABIC = new int[] {
1000,

View File

@ -6,7 +6,9 @@ package com.thealgorithms.conversions;
* @author Bama Charan Chhandogi
*/
public class OctalToBinary {
public final class OctalToBinary {
private OctalToBinary() {
}
public static long convertOctalToBinary(int octalNumber) {
long binaryNumber = 0;
int digitPosition = 1;

View File

@ -7,7 +7,9 @@ import java.util.Scanner;
*
* @author Zachary Jones
*/
public class OctalToDecimal {
public final class OctalToDecimal {
private OctalToDecimal() {
}
/**
* Main method

View File

@ -7,7 +7,9 @@ import java.util.Scanner;
*
* @author Tanmay Joshi
*/
public class OctalToHexadecimal {
public final class OctalToHexadecimal {
private OctalToHexadecimal() {
}
/**
* This method converts a Octal number to a decimal number

View File

@ -13,7 +13,9 @@ import java.util.Arrays;
* (description adapted from <a href="https://en.wikipedia.org/wiki/RGB_color_model">[1]</a> and
* <a href="https://en.wikipedia.org/wiki/HSL_and_HSV">[2]</a>).
*/
public class RgbHsvConversion {
public final class RgbHsvConversion {
private RgbHsvConversion() {
}
public static void main(String[] args) {
// Expected RGB-values taken from https://www.rapidtables.com/convert/color/hsv-to-rgb.html

View File

@ -3,7 +3,9 @@ package com.thealgorithms.conversions;
import java.util.HashMap;
import java.util.Map;
public class RomanToInteger {
public final class RomanToInteger {
private RomanToInteger() {
}
private static final Map<Character, Integer> ROMAN_TO_INT = new HashMap<>() {
{

View File

@ -7,7 +7,9 @@ import java.util.Scanner;
*
* @author Özgün Gökşenli
*/
public class TurkishToLatinConversion {
public final class TurkishToLatinConversion {
private TurkishToLatinConversion() {
}
/**
* Main method