litesoft
@ HEAD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
package org.litesoft.codec; import org.litesoft.commonfoundation.annotations.*; import org.litesoft.commonfoundation.charstreams.*; public class PrimitiveBooleanCodec { public static final PrimitiveBooleanCodec INSTANCE = new PrimitiveBooleanCodec(); private PrimitiveBooleanCodec() { } public void encode( @NotNull CharSink pCharSink, boolean pValue ) { pCharSink.add( pValue ? 'T' : 'F' ); } public boolean decode( @NotNull CharSource pCharSource ) { char zChar = pCharSource.getRequired(); switch ( zChar ) { case 'T': return true; case 'F': return false; default: throw new IllegalArgumentException( "Unacceptable character '" + zChar + "': " + (int) zChar ); } } } |
Commits for litesoft/trunk/Java/core/Anywhere/src/org/litesoft/codec/PrimitiveBooleanCodec.java
Revision | Author | Commited | Message |
---|---|---|---|
948 Diff | GeorgeS | Sat 07 Jun, 2014 23:42:39 +0000 | Jusefuls Formatter Updated to New Code Format |
942 Diff | GeorgeS | Mon 02 Jun, 2014 23:41:46 +0000 | Extracting commonfoundation |
939 Diff | GeorgeS | Mon 02 Jun, 2014 21:30:31 +0000 | Extracting commonfoundation |
831 | GeorgeS | Fri 31 Aug, 2012 22:39:56 +0000 |