Package com.itextpdf.layout.font
Class Range
- java.lang.Object
-
- com.itextpdf.layout.font.Range
-
- Direct Known Subclasses:
Range.FullRange
public class Range extends java.lang.Object
Class represents ordered list ofRange.SubRange
. This class is used inFontInfo
as internal field and in one of the overloads of theFontProvider.addFont(String, String, Range)
method as range of characters to be used in font.To create a custom Range instance
RangeBuilder
shall be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Range.FullRange
(package private) static class
Range.SubRange
-
Field Summary
Fields Modifier and Type Field Description private Range.SubRange[]
ranges
-
Constructor Summary
Constructors Modifier Constructor Description private
Range()
(package private)
Range(java.util.List<Range.SubRange> ranges)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(int n)
Binary search over ordered segments.boolean
equals(java.lang.Object o)
int
hashCode()
private static Range.SubRange[]
normalizeSubRanges(java.util.List<Range.SubRange> ranges)
Order ranges.java.lang.String
toString()
-
-
-
Field Detail
-
ranges
private Range.SubRange[] ranges
-
-
Constructor Detail
-
Range
private Range()
-
Range
Range(java.util.List<Range.SubRange> ranges)
-
-
Method Detail
-
contains
public boolean contains(int n)
Binary search over ordered segments.- Parameters:
n
- numeric character reference based on the character's Unicode code point- Returns:
- true if this Range contains the specified code point, otherwise false
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
normalizeSubRanges
private static Range.SubRange[] normalizeSubRanges(java.util.List<Range.SubRange> ranges)
Order ranges. Replace with a union of ranges in case of overlap.- Parameters:
ranges
- Unsorted list of sub-ranges.- Returns:
- ordered and normalized sub-ranges.
-
-