Module suggest

Class StringTable

java.lang.Object
de.grogra.suggest.scope.StringTable

public class StringTable extends Object
A unique set of strings mapped to a monotonically increasing index. These indexes often useful to bytecode interpreters that have instructions referring to strings by unique integer. Indexing is from 0. We can also get them back out in original order. Yes, I know that this is similar to String.intern() but in this case, I need the index out not just to make these strings unique.
  • Field Details

  • Constructor Details

    • StringTable

      public StringTable()
  • Method Details

    • add

      public int add(String s)
    • get

      public String get(int i)
      Get the ith string or null if out of range
    • size

      public int size()
    • toArray

      public String[] toArray()
      Return an array, possibly of length zero, with all strings sitting at their appropriate index within the array.
    • toList

      public List<String> toList()
      Return a List, possibly of length zero, with all strings sitting at their appropriate index within the array.
    • getNumberOfStrings

      public int getNumberOfStrings()
    • toString

      public String toString()
      Overrides:
      toString in class Object