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.ObjectClass represents ordered list ofRange.SubRange. This class is used inFontInfoas 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
RangeBuildershall be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classRange.FullRange(package private) static classRange.SubRange
-
Field Summary
Fields Modifier and Type Field Description private Range.SubRange[]ranges
-
Constructor Summary
Constructors Modifier Constructor Description privateRange()(package private)Range(java.util.List<Range.SubRange> ranges)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(int n)Binary search over ordered segments.booleanequals(java.lang.Object o)inthashCode()private static Range.SubRange[]normalizeSubRanges(java.util.List<Range.SubRange> ranges)Order ranges.java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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.
-
-