comparison src/org/tmatesoft/hg/internal/Filter.java @ 355:f2c11fe7f3e9

Newline filter shall respect whole stream when deciding whether to process line terminators, hence added stream preview functionality
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 06 Dec 2011 12:57:21 +0100
parents a37ce7145c3f
children
comparison
equal deleted inserted replaced
354:5f9073eabf06 355:f2c11fe7f3e9
26 * @author Artem Tikhomirov 26 * @author Artem Tikhomirov
27 * @author TMate Software Ltd. 27 * @author TMate Software Ltd.
28 */ 28 */
29 public interface Filter { 29 public interface Filter {
30 30
31 // returns a buffer ready to be read. may return original buffer. 31 /**
32 // original buffer may not be fully consumed, #compact() might be operation to perform 32 * Filters data and returns a new buffer with data or an original buffer.
33 * Original buffer may not be fully consumed, #compact() might be operation to perform
34 * @param src
35 * @return a buffer ready to be read
36 */
37 //
33 ByteBuffer filter(ByteBuffer src); 38 ByteBuffer filter(ByteBuffer src);
34 39
40 /*
41 * Factory doesn't look into data (i.e. could't do a preview), works solely with path
42 */
35 interface Factory { 43 interface Factory {
36 void initialize(HgRepository hgRepo); 44 void initialize(HgRepository hgRepo);
37 // may return null if for a given path and/or options this filter doesn't make any sense 45 // may return null if for a given path and/or options this filter doesn't make any sense
38 Filter create(Path path, Options opts); 46 Filter create(Path path, Options opts);
39 } 47 }