Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d100e0

Browse files
committed
[Java] Formatting.
1 parent b61ab85 commit 9d100e0

File tree

1 file changed

+19
-16
lines changed
  • sbe-tool/src/main/java/uk/co/real_logic/sbe/ir

1 file changed

+19
-16
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Token.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,28 @@
1919

2020
import java.util.function.Supplier;
2121

22+
import static uk.co.real_logic.sbe.ir.Encoding.Presence.CONSTANT;
23+
import static uk.co.real_logic.sbe.ir.Encoding.Presence.OPTIONAL;
24+
2225
/**
2326
* Class to encapsulate a token of information for the message schema stream. This Intermediate Representation (IR)
2427
* is intended to be language, schema, platform independent.
2528
*
2629
* Processing and optimization could be run over a list of Tokens to perform various functions
2730
* <ul>
28-
* <li>re-ordering of fields based on encodedLength</li>
29-
* <li>padding of fields in order to provide expansion room</li>
30-
* <li>computing offsets of individual fields</li>
31-
* <li>etc.</li>
31+
* <li>re-ordering of fields based on encodedLength</li>
32+
* <li>padding of fields in order to provide expansion room</li>
33+
* <li>computing offsets of individual fields</li>
34+
* <li>etc.</li>
3235
* </ul>
3336
*
3437
* IR could be used to generate code or other specifications. It should be possible to do the
3538
* following:
3639
* <ul>
37-
* <li>generate a FIX/SBE schema from IR</li>
38-
* <li>generate an ASN.1 spec from IR</li>
39-
* <li>generate a GPB spec from IR</li>
40-
* <li>etc.</li>
40+
* <li>generate a FIX/SBE schema from IR</li>
41+
* <li>generate an ASN.1 spec from IR</li>
42+
* <li>generate a GPB spec from IR</li>
43+
* <li>etc.</li>
4144
* </ul>
4245
*
4346
* IR could be serialized to storage or network via code generated by SBE. Then read back in to
@@ -53,11 +56,11 @@
5356
*
5457
* An example encoding of a message headerStructure might be like this.
5558
* <ul>
56-
* <li>Token 0 - Signal = BEGIN_MESSAGE, schemaId = 100</li>
57-
* <li>Token 1 - Signal = BEGIN_FIELD, schemaId = 25</li>
58-
* <li>Token 2 - Signal = ENCODING, PrimitiveType = uint32, encodedLength = 4, offset = 0</li>
59-
* <li>Token 3 - Signal = END_FIELD</li>
60-
* <li>Token 4 - Signal = END_MESSAGE</li>
59+
* <li>Token 0 - Signal = BEGIN_MESSAGE, schemaId = 100</li>
60+
* <li>Token 1 - Signal = BEGIN_FIELD, schemaId = 25</li>
61+
* <li>Token 2 - Signal = ENCODING, PrimitiveType = uint32, encodedLength = 4, offset = 0</li>
62+
* <li>Token 3 - Signal = END_FIELD</li>
63+
* <li>Token 4 - Signal = END_MESSAGE</li>
6164
* </ul>
6265
*/
6366
public class Token
@@ -218,7 +221,7 @@ public int arrayLength()
218221
return encodedLength / encoding.primitiveType().size();
219222
}
220223

221-
public CharSequence switchArray(Supplier<CharSequence> single, Supplier<CharSequence> array)
224+
public CharSequence switchArray(final Supplier<CharSequence> single, final Supplier<CharSequence> array)
222225
{
223226
final int arrayLength = arrayLength();
224227

@@ -258,12 +261,12 @@ public Encoding encoding()
258261

259262
public boolean isConstantEncoding()
260263
{
261-
return encoding.presence() == Encoding.Presence.CONSTANT;
264+
return encoding.presence() == CONSTANT;
262265
}
263266

264267
public boolean isOptionalEncoding()
265268
{
266-
return encoding.presence() == Encoding.Presence.OPTIONAL;
269+
return encoding.presence() == OPTIONAL;
267270
}
268271

269272
public String toString()

0 commit comments

Comments
 (0)