Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.core.sym;

Specialized implementation of PName: can be used for short Strings that consists of at most 4 bytes. Usually this means short ascii-only names.

The reason for such specialized classes is mostly space efficiency; and to a lesser degree performance. Both are achieved for short Strings by avoiding another level of indirection (via quad arrays)

public final class Name1
    extends Name
    final static Name1 sEmptyName = new Name1("", 0, 0);
    final int mQuad;
    Name1(String nameint hashint quad)
    {
        super(namehash);
         = quad;
    }
    static Name1 getEmptyName() { return ; }
    @Override
    public boolean equals(int quad)
    {
        return (quad == );
    }
    @Override
    public boolean equals(int quad1int quad2)
    {
        return (quad1 == ) && (quad2 == 0);
    }
    @Override
    public boolean equals(int[] quadsint qlen)
    {
        return (qlen == 1 && quads[0] == );
    }
New to GrepCode? Check out our FAQ X