forked from NASAWorldWind/WorldWindJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathName2.java
More file actions
37 lines (31 loc) · 957 Bytes
/
Name2.java
File metadata and controls
37 lines (31 loc) · 957 Bytes
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
package org.codehaus.jackson.sym;
/**
* Specialized implementation of PName: can be used for short Strings
* that consists of 5 to 8 bytes. Usually this means relatively short
* ascii-only names.
*<p>
* 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 Name2
extends Name
{
final int mQuad1;
final int mQuad2;
Name2(String name, int hash, int quad1, int quad2)
{
super(name, hash);
mQuad1 = quad1;
mQuad2 = quad2;
}
public boolean equals(int quad) { return false; }
public boolean equals(int quad1, int quad2)
{
return (quad1 == mQuad1) && (quad2 == mQuad2);
}
public boolean equals(int[] quads, int qlen)
{
return (qlen == 2 && quads[0] == mQuad1 && quads[1] == mQuad2);
}
}