Package io.datarouter.types
Record Class Quad
java.lang.Object
java.lang.Record
io.datarouter.types.Quad
- All Implemented Interfaces:
Comparable<Quad>
Represents a Microsoft style String "quad" like 03112003 in a 64 bit long.
https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system
The leftmost bit is blank. The last 5 bits represent the level which can be 0 through 29.
The 58 remaining "grid" bits are left justified so that the "bits" field can also be used as an efficient hashCode
y is the direction that is shifted left one bit
Natural ordering is the same as ordering Microsoft style quad strings
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuild the lookup tables for dilation and contraction. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongbits()Returns the value of thebitsrecord component.intfinal booleanIndicates whether some other object is "equal to" this one.fromMicrosoftStyleStrings(Collection<String> microsoftStrings) getAtLevel(int level) getDescendantAtLevel(int level) longgetLastPossibleSubQuadAtLevel(int level) static StringgetLastPossibleSubQuadFromString(String quadString) intgetLevel()Deprecated.longlonggetX()longgetY()final inthashCode()Returns a hash code value for this object.booleanbooleanisChildOfOrEqualTo(Quad other) booleanisParentOfOrEqualTo(Quad other) booleanisRoot()booleanisXEven()booleanisYEven()shiftUp()toString()Returns a string representation of this record class.
-
Field Details
-
TOP_QUAD
-
EMPTY_STRING_QUAD
-
SIXTEEN_ZERO_STRING
- See Also:
-
RIGHT_BIT_TABLE_MASK
public static final int RIGHT_BIT_TABLE_MASK- See Also:
-
RIGHT_BIT_LOOK_UP_TABLE
public static final int[] RIGHT_BIT_LOOK_UP_TABLE
-
-
Constructor Details
-
Quad
public Quad() -
Quad
public Quad(long bits) Creates an instance of aQuadrecord class.- Parameters:
bits- the value for thebitsrecord component
-
Quad
public Quad(long level, long xPosition, long yPosition) -
Quad
-
-
Method Details
-
getNumQuadsAcross
public long getNumQuadsAcross() -
isRoot
public boolean isRoot() -
getAtLevel
-
getLastPossibleSubQuad
-
getLastPossibleSubQuadAtLevel
-
getLevel
public int getLevel() -
getX
public long getX() -
getY
public long getY() -
isXEven
public boolean isXEven() -
isYEven
public boolean isYEven() -
getGridBits
public long getGridBits() -
getParent
-
getChildren
-
getDescendantAtLevel
-
get3Siblings
-
isParentOfOrEqualTo
-
isChildOfOrEqualTo
-
isChildOf
-
shiftLeft
-
shiftRight
-
shiftUp
-
shiftDown
-
toMicrosoftStyleString
-
getMicrosoftStyleString
Deprecated. -
getLastPossibleSubQuadFromString
-
fromMicrosoftStyleStrings
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
compareTo
- Specified by:
compareToin interfaceComparable<Quad>
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
bits
public long bits()Returns the value of thebitsrecord component.- Returns:
- the value of the
bitsrecord component
-