Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dataflow laundering
/**
* A toy example of laundering data through "implicit dataflow paths"
* The launder method uses the input data to reconstruct a new result
* with the same value as the original input.
*
* @author Ben Holland
*/
public class DataflowLaunder {
public static void main(String[] args) {
String x = "1010";
String y = launder(x);
System.out.println(y + " is a laundered version of " + x);
}
public static String launder(String data){
String result = "";
for(char c : data.toCharArray()){
if(c == '0')
result += '0';
else
result += '1';
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.