/** * Creates a new buffered rule based scanner which does * not have any rule. The buffer size is set to the given * number of characters. * * @param size the buffer size */ public BufferedRuleBasedScanner(int size) { super(); setBufferSize(size); }
/** * {@inheritDoc} * <p> * If the given content type is not <code>null</code> then this scanner will first try the rules * that match the given content type. * </p> */ public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) { fContentType= contentType; fPartitionOffset= partitionOffset; if (partitionOffset > -1) { int delta= offset - partitionOffset; if (delta > 0) { super.setRange(document, partitionOffset, length + delta); fOffset= offset; return; } } super.setRange(document, offset, length); }
public void setPredicateRules(IPredicateRule[] rules) { super.setRules(rules); }
@Override public IToken nextToken() { if (fNeedsLazyColorLoading) resolveProxyAttributes(); return super.nextToken(); }
public int read() { fColumn= UNDEFINED; if (fOffset >= fRangeEnd) { ++ fOffset; return EOF; } if (fOffset == fEnd) shiftBuffer(fEnd); else if (fOffset < fStart || fEnd < fOffset) shiftBuffer(fOffset); return fBuffer[fOffset++ - fStart]; }
@Override public IToken nextToken() { if (fNeedsLazyColorLoading) resolveProxyAttributes(); return super.nextToken(); }
@Override public int read() { fColumn= UNDEFINED; if (fOffset >= fRangeEnd) { ++ fOffset; return EOF; } if (fOffset == fEnd) shiftBuffer(fEnd); else if (fOffset < fStart || fEnd < fOffset) shiftBuffer(fOffset); return fBuffer[fOffset++ - fStart]; }
public IToken nextToken() { if (fNeedsLazyColorLoading) resolveProxyAttributes(); return super.nextToken(); }
public int read() { fColumn= UNDEFINED; if (fOffset >= fRangeEnd) { ++ fOffset; return EOF; } if (fOffset == fEnd) shiftBuffer(fEnd); else if (fOffset < fStart || fEnd < fOffset) shiftBuffer(fOffset); return fBuffer[fOffset++ - fStart]; }
/** * Creates a new buffered rule based scanner which does * not have any rule. The buffer size is set to the given * number of characters. * * @param size the buffer size */ public BufferedRuleBasedScanner(int size) { super(); setBufferSize(size); }
public void setPredicateRules(IPredicateRule[] rules) { super.setRules(rules); }
/** * {@inheritDoc} * <p> * If the given content type is not <code>null</code> then this scanner will first try the rules * that match the given content type. * </p> */ public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) { fContentType= contentType; fPartitionOffset= partitionOffset; if (partitionOffset > -1) { int delta= offset - partitionOffset; if (delta > 0) { super.setRange(document, partitionOffset, length + delta); fOffset= offset; return; } } super.setRange(document, offset, length); }
@Override public int read() { fColumn= UNDEFINED; if (fOffset >= fRangeEnd) { ++ fOffset; return EOF; } if (fOffset == fEnd) shiftBuffer(fEnd); else if (fOffset < fStart || fEnd < fOffset) shiftBuffer(fOffset); return fBuffer[fOffset++ - fStart]; }
/** * Creates a new buffered rule based scanner which does * not have any rule. The buffer size is set to the given * number of characters. * * @param size the buffer size */ public BufferedRuleBasedScanner(int size) { super(); setBufferSize(size); }
public void setPredicateRules(IPredicateRule[] rules) { super.setRules(rules); }
/** * {@inheritDoc} * <p> * If the given content type is not <code>null</code> then this scanner will first try the rules * that match the given content type. * </p> */ @Override public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) { fContentType= contentType; fPartitionOffset= partitionOffset; if (partitionOffset > -1) { int delta= offset - partitionOffset; if (delta > 0) { super.setRange(document, partitionOffset, length + delta); fOffset= offset; return; } } super.setRange(document, offset, length); }
@Override public void unread() { if (fOffset == fStart) shiftBuffer(Math.max(0, fStart - (fBufferSize / 2))); --fOffset; fColumn= UNDEFINED; } }
/** * Creates a new buffered rule based scanner which does * not have any rule. The buffer size is set to the given * number of characters. * * @param size the buffer size */ public BufferedRuleBasedScanner(int size) { super(); setBufferSize(size); }