Skip to content

Commit d9c086f

Browse files
committed
Adding marble diagrams to StringObservable operator javadocs
1 parent 50b618e commit d9c086f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

rxjava-contrib/rxjava-string/src/main/java/rx/observables/StringObservable.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class StringObservable {
4040
/**
4141
* Reads from the bytes from a source {@link InputStream} and outputs {@link Observable} of
4242
* {@code byte[]}s
43+
* <p>
44+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.from.png">
4345
*
4446
* @param i
4547
* Source {@link InputStream}
@@ -52,6 +54,8 @@ public static Observable<byte[]> from(final InputStream i) {
5254
/**
5355
* Reads from the bytes from a source {@link InputStream} and outputs {@link Observable} of
5456
* {@code byte[]}s
57+
* <p>
58+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.from.png">
5559
*
5660
* @param i
5761
* Source {@link InputStream}
@@ -86,6 +90,8 @@ public void call(Subscriber<? super byte[]> o) {
8690
/**
8791
* Reads from the characters from a source {@link Reader} and outputs {@link Observable} of
8892
* {@link String}s
93+
* <p>
94+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.from.png">
8995
*
9096
* @param i
9197
* Source {@link Reader}
@@ -98,6 +104,8 @@ public static Observable<String> from(final Reader i) {
98104
/**
99105
* Reads from the characters from a source {@link Reader} and outputs {@link Observable} of
100106
* {@link String}s
107+
* <p>
108+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.from.png">
101109
*
102110
* @param i
103111
* Source {@link Reader}
@@ -132,6 +140,8 @@ public void call(Subscriber<? super String> o) {
132140
/**
133141
* Decodes a stream the multibyte chunks into a stream of strings that works on infinite streams
134142
* and where handles when a multibyte character spans two chunks.
143+
* <p>
144+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.decode.png">
135145
*
136146
* @param src
137147
* @param charsetName
@@ -144,6 +154,8 @@ public static Observable<String> decode(Observable<byte[]> src, String charsetNa
144154
/**
145155
* Decodes a stream the multibyte chunks into a stream of strings that works on infinite streams
146156
* and where handles when a multibyte character spans two chunks.
157+
* <p>
158+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.decode.png">
147159
*
148160
* @param src
149161
* @param charset
@@ -157,6 +169,8 @@ public static Observable<String> decode(Observable<byte[]> src, Charset charset)
157169
* Decodes a stream the multibyte chunks into a stream of strings that works on infinite streams
158170
* and where it handles when a multibyte character spans two chunks.
159171
* This method allows for more control over how malformed and unmappable characters are handled.
172+
* <p>
173+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.decode.png">
160174
*
161175
* @param src
162176
* @param charsetDecoder
@@ -246,6 +260,8 @@ public boolean process(byte[] next, ByteBuffer last, boolean endOfInput) {
246260

247261
/**
248262
* Encodes a possible infinite stream of strings into a Observable of byte arrays.
263+
* <p>
264+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.encode.png">
249265
*
250266
* @param src
251267
* @param charsetName
@@ -257,6 +273,8 @@ public static Observable<byte[]> encode(Observable<String> src, String charsetNa
257273

258274
/**
259275
* Encodes a possible infinite stream of strings into a Observable of byte arrays.
276+
* <p>
277+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.encode.png">
260278
*
261279
* @param src
262280
* @param charset
@@ -269,6 +287,8 @@ public static Observable<byte[]> encode(Observable<String> src, Charset charset)
269287
/**
270288
* Encodes a possible infinite stream of strings into a Observable of byte arrays.
271289
* This method allows for more control over how malformed and unmappable characters are handled.
290+
* <p>
291+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.encode.png">
272292
*
273293
* @param src
274294
* @param charsetEncoder
@@ -293,6 +313,8 @@ public byte[] call(String str) {
293313
/**
294314
* Gather up all of the strings in to one string to be able to use it as one message. Don't use
295315
* this on infinite streams.
316+
* <p>
317+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.stringConcat.png">
296318
*
297319
* @param src
298320
* @return the Observable returing all strings concatenated as a single string
@@ -315,6 +337,8 @@ public String call(String a, String b) {
315337
* </pre>
316338
*
317339
* See {@link Pattern}
340+
* <p>
341+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.split.png">
318342
*
319343
* @param src
320344
* @param regex
@@ -384,6 +408,8 @@ private void output(String part) {
384408
* Concatenates the sequence of values by adding a separator
385409
* between them and emitting the result once the source completes.
386410
* <p>
411+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.join.png">
412+
* <p>
387413
* The conversion from the value type to String is performed via
388414
* {@link java.lang.String#valueOf(java.lang.Object)} calls.
389415
* <p>
@@ -487,6 +513,8 @@ public String toString() {
487513

488514
/**
489515
* Splits the {@link Observable} of Strings by lines and numbers them (zero based index)
516+
* <p>
517+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/St.byLine.png">
490518
*
491519
* @param source
492520
* @return the Observable conaining the split lines of the source

0 commit comments

Comments
 (0)