Package parser

Class LISTS

java.lang.Object
parser.LISTS

public class LISTS extends Object
  • Constructor Details

    • LISTS

      public LISTS()
  • Method Details

    • firstoccurrenceOfStatsOrLogOrAntilogBehind

      public static int firstoccurrenceOfStatsOrLogOrAntilogBehind(int start, List<String> list)
      Parameters:
      start - the starting index of the search from where we search backwards for the first occurrence of a string that represents a statistical operator( e.g sum(,sort(,med(,st_err( e.t.c ) or a logtoanybase operator e.g log(a,b) where a and b are numbers or an antilogtoanybaseoperator that index itself been not included
      list - the collection of objects that the search is to be carried out on
      Returns:
      the index of the first occurrence of the object behind index start or -1 if the object is not found.
    • firstoccurrenceOfStatsOrLogOrAntilogBeyond

      public static int firstoccurrenceOfStatsOrLogOrAntilogBeyond(int start, List<String> list)
      Parameters:
      start - the starting index of the search from where we search forwards for the first occurrence of a string that represents a statistical operator( e.g sum(,sort(,med(,st_err( e.t.c ) or a logtoanybase operator e.g log(a,b) where a and b are numbers or an antilogtoanybaseoperator that index itself been not included
      list - the collection of objects that the search is to be carried out on
      Returns:
      the index of the first occurrence of the object beyond index start or -1 if the object is not found.
    • prevIndexOf

      public static int prevIndexOf(List list, int start, Object sought)
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search backwards for the object that index itself been not included
      sought - the object that we seek
      Returns:
      the index of the first occurrence of the object behind index start or -1 if the object is not found.
    • nextIndexOf

      public static int nextIndexOf(List list, int start, Object sought)
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index included. So if the search item is found at the start, the search returns instantly.
      sought - the object that we seek
      Returns:
      the index of the first occurrence of the object after start or -1 if the object is not found.
    • nextIndexOfMulOrDivOrRem

      public static int nextIndexOfMulOrDivOrRem(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a * or / or % operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfMulOrDivOrRem

      public static int prevIndexOfMulOrDivOrRem(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a * or / or % operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfPowerOperator

      public static int nextIndexOfPowerOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a power operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfPowerOperator

      public static int prevIndexOfPowerOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a power operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfVariable

      public static int nextIndexOfVariable(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Variable String from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfVariable

      public static int prevIndexOfVariable(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a Variable String from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfPermOrCombOperator

      public static int nextIndexOfPermOrCombOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a permutation or combination operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfPermOrCombOperator

      public static int prevIndexOfPermOrCombOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a permutation or combination operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfInBetweenOperatorOrComma

      public static int nextIndexOfInBetweenOperatorOrComma(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of an In Between Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfInBetweenOperator

      public static int prevIndexOfInBetweenOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of an In Between Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfPreNumberOperator

      public static int nextIndexOfPreNumberOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Pre Number Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfPreNumberOperator

      public static int prevIndexOfPreNumberOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a Pre-Number Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfPostNumberOperator

      public static int nextIndexOfPostNumberOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Post Number Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfPostNumberOperator

      public static int prevIndexOfPostNumberOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a Post Number Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfNumberReturningStatsOperator

      public static int nextIndexOfNumberReturningStatsOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Number Type Stats Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfNumberReturningStatsOperator

      public static int prevIndexOfNumberReturningStatsOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a NumberReturningStatsOperator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfListReturningStatsOperator

      public static int nextIndexOfListReturningStatsOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a ListTypeStats Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfListReturningStatsOperator

      public static int prevIndexOfListReturningStatsOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a ListReturningStatsOperator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfLogOrAntiLogToAnyBase

      public static int nextIndexOfLogOrAntiLogToAnyBase(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a LogOrAntiLogToAnyBase Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfLogOrAntiLogToAnyBase

      public static int prevIndexOfLogOrAntiLogToAnyBase(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a LogOrAntiLogToAnyBase Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfLogicOperator

      public static int nextIndexOfLogicOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Logic Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfLogicOperator

      public static int prevIndexOfLogicOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a Logic Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfComma

      public static int nextIndexOfComma(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Comma String object from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • prevIndexOfComma

      public static int prevIndexOfComma(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a Comma String Object from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • nextIndexOfOperator

      public static int nextIndexOfOperator(List<String> list, int start)
      Searches a List of String objects forwards for the first occurrence of a Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • createStringFrom

      public static String createStringFrom(List<String> list, int start, int end)
      Parameters:
      list - The List from which the copy is to be done
      start - The index to start the copy from
      end - The index where the copy is to end(excluded).
      Returns:
      a String that contains the concatenation of all items between index start and index end(excluded.) of the List.
    • prevIndexOfOperator

      public static int prevIndexOfOperator(List<String> list, int start)
      Searches a List of String objects backwards for the first occurrence of a Operator from the point where the search commences.
      Parameters:
      list - the collection of objects that the search is to be carried out on
      start - the starting index of the search from where we search forwards for the object that index itself been not included
      Returns:
      the index of the first occurrence of the String object after start or -1 if the object is not found.
    • cutPortionOfList

      public static List cutPortionOfList(List list, int start, int end)
      Parameters:
      list - the collection of objects that we wish to modify
      start - the index at which we start removing items from the list(start inclusive)
      end - the index at which we stop removing items (end exclusive)
      Returns:
      the list without all elements between start(start inclusive) and end(not inclusive) e.g for list L=[0,1,2,3,4,5,6,7,8,9],cutPortionOfList( L,6,8) = [0,1,2,3,4,5,8,9]
    • main

      public static void main(String[] args)