Sha256: 4dd3513a8e2c131ebf85138008ce6f22db85e4d846f907f5e3a0b3d95274be99

Contents?: true

Size: 1.8 KB

Versions: 164

Compression:

Stored size: 1.8 KB

Contents

package sh.calaba.org.codehaus.jackson.sym;

/**
 * Generic implementation of PName used for "long" names, where long
 * means that its byte (UTF-8) representation is 13 bytes or more.
 */
public final class NameN
    extends Name
{
    final int[] mQuads;
    final int mQuadLen;

    NameN(String name, int hash, int[] quads, int quadLen)
    {
        super(name, hash);
        /* We have specialized implementations for shorter
         * names, so let's not allow runt instances here
         */
        if (quadLen < 3) {
            throw new IllegalArgumentException("Qlen must >= 3");
        }
        mQuads = quads;
        mQuadLen = quadLen;
    }

    // Implies quad length == 1, never matches
    @Override
	public boolean equals(int quad) { return false; }

    // Implies quad length == 2, never matches
    @Override
	public boolean equals(int quad1, int quad2) { return false; }

    @Override
	public boolean equals(int[] quads, int qlen)
    {
        if (qlen != mQuadLen) {
            return false;
        }

        /* 26-Nov-2008, tatus: Strange, but it does look like
         *   unrolling here is counter-productive, reducing
         *   speed. Perhaps it prevents inlining by HotSpot or
         *   something...
         */
        // Will always have >= 3 quads, can unroll
        /*
        if (quads[0] == mQuads[0]
            && quads[1] == mQuads[1]
            && quads[2] == mQuads[2]) {
            for (int i = 3; i < qlen; ++i) {
                if (quads[i] != mQuads[i]) {
                    return false;
                }
            }
            return true;
        }
        */

        // or simpler way without unrolling:
        for (int i = 0; i < qlen; ++i) {
            if (quads[i] != mQuads[i]) {
                return false;
            }
        }
        return true;
    }
}

Version data entries

164 entries across 164 versions & 2 rubygems

Version Path
calabash-android-0.4.3.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.3.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
testautoa-0.4.1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre18 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
testautoa-0.4.0.pre19 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
testautoa-0.4.0.pre18 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
testautoa-0.4.0.pre16 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre17 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre16 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre15 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre11 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre10 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre9 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre8 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre7 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre6 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java
calabash-android-0.4.0.pre5 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java