1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package Torello.JavaDoc.SyntaxHiLite;

import java.util.Arrays;
import java.util.Objects;

class ACEqualsToString 
{
    static boolean equals(final AbstractConfig<?> THIS, final Object other)
    {
        if (THIS == other) return true;
        if (other == null) return false;

        if (! (other instanceof AbstractConfig)) return false;

        @SuppressWarnings("rawtypes")
        AbstractConfig o = (AbstractConfig) other;

        return
                (THIS.CONFIG_ARR_LEN == o.CONFIG_ARR_LEN)
            &&  Objects.equals(THIS.captureTheClassDummy, o.captureTheClassDummy)

            &&  Arrays.equals(THIS.classNames,      o.classNames)
            &&  Arrays.equals(THIS.spansOrBolds,    o.spansOrBolds)
            &&  Arrays.equals(THIS.utilize,         o.utilize)

            // Tag-Case / Upper-Case or Lower-Case
            &&  (THIS.upperOrLower_TagName          == o.upperOrLower_TagName)
            &&  (THIS.upperOrLower_ClassAttrName    == o.upperOrLower_ClassAttrName)
            &&  Objects.equals(THIS.quotes, o.quotes);
    }

    static int hashCode(final AbstractConfig<?> THIS)
    {
        int ret = 0;

        for (int i=0; i < THIS.CONFIG_ARR_LEN; i += 3)
            ret += THIS.classNames[i].hashCode();

        for (int i=0; i < THIS.CONFIG_ARR_LEN; i += 3)
            ret += (THIS.spansOrBolds[i] ? 1 : 0) * 1;

        return ret;
    }
}