1 17 18 19 20 package org.apache.fop.layoutmgr.inline; 21 22 30 public class HyphContext { 31 private int[] hyphPoints; 32 private int currentOffset = 0; 33 private int currentIndex = 0; 34 35 public HyphContext(int[] hyphPoints) { 36 this.hyphPoints = hyphPoints; 37 } 38 39 public int getNextHyphPoint() { 40 for (; currentIndex < hyphPoints.length; currentIndex++) { 41 if (hyphPoints[currentIndex] > currentOffset) { 42 return (hyphPoints[currentIndex] - currentOffset); 43 } 44 } 45 return -1; } 47 48 public boolean hasMoreHyphPoints() { 49 for (; currentIndex < hyphPoints.length; currentIndex++) { 50 if (hyphPoints[currentIndex] > currentOffset) { 51 return true; 52 } 53 } 54 return false; 55 } 56 57 public void updateOffset(int iCharsProcessed) { 58 currentOffset += iCharsProcessed; 59 } 60 } 61 | Popular Tags |