/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 */
package com.l7tech.server.service.resolution;

import com.l7tech.objectmodel.Goid;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Pattern;

class f {
    private final String a;
    private Goid b;
    private Set<f> c;
    private static final String e = f.a(20, f.a("1\u0019"));

    public f() {
        this(null);
    }

    public f(String string) {
        this.a = string;
    }

    public boolean isWildcard() {
        return false;
    }

    public String getWord() {
        return this.a;
    }

    public Pattern getPattern() {
        return null;
    }

    public Goid getGoid() {
        return this.b;
    }

    public void setGoid(Goid goid) {
        this.b = goid;
    }

    public boolean hasChildren() {
        return this.c != null && !this.c.isEmpty();
    }

    public boolean hasNoChildren() {
        return !this.hasChildren();
    }

    public Set<f> getChildren() {
        return this.c;
    }

    public void addChild(f f2) {
        if (this.c == null) {
            this.c = new HashSet<f>();
        }
        this.c.add(f2);
    }

    public void removeChild(f f2) {
        if (this.hasChildren()) {
            this.c.remove(f2);
        }
    }

    public f getChildContaining(String string) {
        if (this.hasNoChildren()) {
            return null;
        }
        for (f f2 : this.c) {
            if (!f2.getWord().equals(string)) continue;
            return f2;
        }
        return null;
    }

    public boolean wasInsertedAsLeaf() {
        return null != this.b;
    }

    public String toString() {
        return (this.a != null ? this.a : "/") + (String)(this.b != null ? e + String.valueOf(this.b) : "");
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x25);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 5;
                    case 1 -> 46;
                    case 2 -> 121;
                    case 3 -> 112;
                    case 4 -> 35;
                    case 5 -> 40;
                    default -> 37;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

