I am basically writing static methods that perform work on a list of strings but I can't quite determine if it would be better to create instance variable and do all the work internally. In case my question isn't clear: what needs to be accounted for when makes this decision? If encapsulation needs to be always the first choice, then I guess I would be better in choosing instance variables and methods.
Methods:
public static List<String> split(String string)
{
List<String> list = new ArrayList<>();
...
return list;
}
public static int count(List<String> stringBlocks)
{
...
return counter;
}
private static List<String> createList(List<String> stringBlocks, int currentCap, int lastCap)
{
List<String> list = new ArrayList<>();
...
return list;
}
public static List<List<String>> makeJoinedLists(List<String> stringBlocks)
{
List<List<String>> lists = new ArrayList<>();
...
return lists;
}
public static List<String> performWork(List<List<String>> lists)
{
List<List<String>> lists = new ArrayList<>();
...
return lists;
}
performWork”.