1 package org.apache.regexp; 2 3 59 60 64 public final class CharacterArrayCharacterIterator implements CharacterIterator 65 { 66 67 private final char[] src; 68 69 private final int off; 70 71 private final int len; 72 73 74 public CharacterArrayCharacterIterator(char[] src, int off, int len) 75 { 76 this.src = src; 77 this.off = off; 78 this.len = len; 79 } 80 81 82 public String substring(int offset, int length) 83 { 84 return new String (src, off + offset, length); 85 } 86 87 88 public String substring(int offset) 89 { 90 return new String (src, off + offset, len); 91 } 92 93 94 public char charAt(int pos) 95 { 96 return src[off + pos]; 97 } 98 99 100 public boolean isEnd(int pos) 101 { 102 return (pos >= len); 103 } 104 } 105 | Popular Tags |