style: enable FinalClass
in checkstyle (#5154)
This commit is contained in:
parent
52f15b2b08
commit
bbe4a025df
@ -174,7 +174,7 @@
|
||||
<!-- Checks for class design -->
|
||||
<!-- See https://checkstyle.org/checks/design/index.html -->
|
||||
<!-- TODO <module name="DesignForExtension"/> -->
|
||||
<!-- TODO <module name="FinalClass"/> -->
|
||||
<module name="FinalClass"/>
|
||||
<module name="HideUtilityClassConstructor"/>
|
||||
<module name="InterfaceIsType"/>
|
||||
<!-- TODO <module name="VisibilityModifier"/> -->
|
||||
|
@ -13,7 +13,7 @@ public class Bag<Element> implements Iterable<Element> {
|
||||
private Node<Element> firstElement; // first element of the bag
|
||||
private int size; // size of bag
|
||||
|
||||
private static class Node<Element> {
|
||||
private static final class Node<Element> {
|
||||
|
||||
private Element content;
|
||||
private Node<Element> nextElement;
|
||||
|
@ -153,7 +153,7 @@ public class DynamicArray<E> implements Iterable<E> {
|
||||
return new DynamicArrayIterator();
|
||||
}
|
||||
|
||||
private class DynamicArrayIterator implements Iterator<E> {
|
||||
private final class DynamicArrayIterator implements Iterator<E> {
|
||||
|
||||
private int cursor;
|
||||
|
||||
|
@ -17,7 +17,7 @@ public final class WelshPowell {
|
||||
private WelshPowell() {
|
||||
}
|
||||
|
||||
static class Graph {
|
||||
static final class Graph {
|
||||
private HashSet<Integer>[] adjacencyLists;
|
||||
|
||||
private Graph(int vertices) {
|
||||
|
@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Intersection {
|
||||
public final class Intersection {
|
||||
|
||||
public static List<Integer> intersection(int[] arr1, int[] arr2) {
|
||||
if (arr1 == null || arr2 == null || arr1.length == 0 || arr2.length == 0) {
|
||||
|
@ -13,7 +13,7 @@ import java.util.ArrayList;
|
||||
*/
|
||||
|
||||
public class LeftistHeap {
|
||||
private class Node {
|
||||
private final class Node {
|
||||
private int element, npl;
|
||||
private Node left, right;
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.thealgorithms.datastructures.lists;
|
||||
|
||||
public class CircleLinkedList<E> {
|
||||
|
||||
private static class Node<E> {
|
||||
private static final class Node<E> {
|
||||
|
||||
Node<E> next;
|
||||
E value;
|
||||
|
@ -43,7 +43,7 @@ public class Merge_K_SortedLinkedlist {
|
||||
return head;
|
||||
}
|
||||
|
||||
private class Node {
|
||||
private final class Node {
|
||||
|
||||
private int data;
|
||||
private Node next;
|
||||
|
@ -16,7 +16,7 @@ import java.util.Scanner;
|
||||
*/
|
||||
public class GenericTree {
|
||||
|
||||
private static class Node {
|
||||
private static final class Node {
|
||||
|
||||
int data;
|
||||
ArrayList<Node> child = new ArrayList<>();
|
||||
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class TreeRandomNode {
|
||||
|
||||
private class Node {
|
||||
private final class Node {
|
||||
|
||||
int item;
|
||||
Node left, right;
|
||||
|
@ -126,7 +126,7 @@ public class GrahamScan {
|
||||
return new PolarOrder();
|
||||
}
|
||||
|
||||
private class PolarOrder implements Comparator<Point> {
|
||||
private final class PolarOrder implements Comparator<Point> {
|
||||
public int compare(Point p1, Point p2) {
|
||||
int dx1 = p1.x - x;
|
||||
int dy1 = p1.y - y;
|
||||
|
@ -6,7 +6,7 @@ package com.thealgorithms.others;
|
||||
*/
|
||||
import java.util.Scanner;
|
||||
|
||||
class Rotate_by_90_degrees {
|
||||
final class Rotate_by_90_degrees {
|
||||
private Rotate_by_90_degrees() {
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user