Back to project page latrobe-datacapture-dir.
The source code is released under:
MIT License
If you think the Android project latrobe-datacapture-dir listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.DataCaptureApp.transforms; /*from w ww . j av a2 s. co m*/ import com.example.DataCaptureApp.data.Data; import com.example.DataCaptureApp.data.DataTransform; /** * Created by Tom on 21/09/2014. */ public class ArraySplitDataTransform extends DataTransform { private String mSourceKey; private String[] mNewKeys; private boolean mAppend; public ArraySplitDataTransform(String sourceKey, String[] newKeys, boolean append) { mSourceKey = sourceKey; mNewKeys = newKeys; mAppend = append; } @Override public synchronized Data transform(Data d) { Object[] compositeKey = d.get(mSourceKey); if(compositeKey != null) { d.remove(mSourceKey); int max = compositeKey.length > mNewKeys.length ? mNewKeys.length : compositeKey.length; for (int i = 0; i < max; ++i) { d.set(mAppend ? mSourceKey + mNewKeys[i] : mNewKeys[i], compositeKey[i]); } } return d; } }