Android Open Source - FlashTransmitter Line Coder Factory






From Project

Back to project page FlashTransmitter.

License

The source code is released under:

GNU General Public License

If you think the Android project FlashTransmitter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.catinthedark.flash_transmitter.lib.factories;
//from w ww  .j  a va 2  s  .c  o m
import com.catinthedark.flash_transmitter.lib.algorithm.LineCoder;
import com.catinthedark.flash_transmitter.lib.algorithm.ManchesterLineCoder;
import com.google.common.collect.ImmutableMap;
import java.lang.UnsupportedOperationException;

import java.util.Map;
import java.util.Set;

/**
 * Created by ilyab_000 on 20.04.2014.
 */
public class LineCoderFactory {
    public static final String defaultCoder = "Manchester 802.3";
    public static final Map<String, Class> CODERS_LIST = ImmutableMap.<String, Class>builder()
            .put("Manchester 802.3", ManchesterLineCoder.class)
            .build();

    public static LineCoder build(String klass) throws UnsupportedOperationException {
        Class scheme = CODERS_LIST.get(klass);
        if (scheme != null) {
            try {
                return (LineCoder) scheme.newInstance();
            } catch (InstantiationException e) {
                throw new UnsupportedOperationException();
            } catch (IllegalAccessException e) {
                throw new UnsupportedOperationException();
            }
        } else {
            throw new UnsupportedOperationException();
        }
    }
    public static String[] getCodersNames() {
        Set<String> keys = CODERS_LIST.keySet();
        return keys.toArray(new String[keys.size()]);
    }

}




Java Source Code List

com.catinthedark.activity.ReceiveActivity.java
com.catinthedark.activity.StartActivity.java
com.catinthedark.activity.TransmitActivity.java
com.catinthedark.flash_transmitter.lib.algorithm.ASCIIScheme.java
com.catinthedark.flash_transmitter.lib.algorithm.CompressedScheme.java
com.catinthedark.flash_transmitter.lib.algorithm.Converter.java
com.catinthedark.flash_transmitter.lib.algorithm.EmptyErrorCorrectionLayer.java
com.catinthedark.flash_transmitter.lib.algorithm.EmptyLogicalCodeLayer.java
com.catinthedark.flash_transmitter.lib.algorithm.EncodingScheme.java
com.catinthedark.flash_transmitter.lib.algorithm.ErrorCorrectionLayer.java
com.catinthedark.flash_transmitter.lib.algorithm.Filter.java
com.catinthedark.flash_transmitter.lib.algorithm.LineCoder.java
com.catinthedark.flash_transmitter.lib.algorithm.LogicalCodeLayer.java
com.catinthedark.flash_transmitter.lib.algorithm.ManchesterLineCoder.java
com.catinthedark.flash_transmitter.lib.algorithm.ManchesterSynchronizer.java
com.catinthedark.flash_transmitter.lib.algorithm.RawDataTranslator.java
com.catinthedark.flash_transmitter.lib.algorithm.Synchronizer.java
com.catinthedark.flash_transmitter.lib.factories.EncodingSchemeFactory.java
com.catinthedark.flash_transmitter.lib.factories.ErrorCorrectionFactory.java
com.catinthedark.flash_transmitter.lib.factories.LineCoderFactory.java
com.catinthedark.flash_transmitter.lib.factories.LogicalCodeFactory.java
com.catinthedark.task.SubmitDataTask.java