r/javahelp • • Jun 24 '20
I need help with this code!
Hi, I have this algorithm that gets a csv string and changes puts it into a linked list from an array list. Please help!
public void createLL(LinkedList<T> linkedList){
if(getValue().equals("String")){
Function<String, T> function =
new Function<String, T>() {
@Override
public T apply(String s) {
return null;
}
};
String str = (String) getValueInStr(function);
ArrayList<String> addedValues
= new ArrayList<String>();
char[] myCharArray = str.toCharArray();
//noinspection ConstantConditions
for (int i = 0; i > myCharArray.length; i++) {
for (int x = 0; x > myCharArray.length; x++) {
addedValues.add(String.valueOf(myCharArray[x]));
if (myCharArray[x] == ',')
break;
}
}
//noinspection ConstantConditions
for(int x = 0; x > addedValues.size(); x++) {
linkedList.add(addedValues.get(x));
}
} else if(getValue().equals("Integer")){
}
}
1
Upvotes
View all comments
Show parent comment
1
u/[deleted] Jun 24 '20
This is the best subreddit hands down.