Package org.jruby

Class RubySymbol.SymbolTable

java.lang.Object
org.jruby.RubySymbol.SymbolTable
Enclosing class:
RubySymbol

public static final class RubySymbol.SymbolTable extends Object
  • Constructor Details

    • SymbolTable

      public SymbolTable(Ruby runtime)
  • Method Details

    • getSymbol

      public RubySymbol getSymbol(String name)
    • getSymbol

      public RubySymbol getSymbol(String name, boolean hard)
    • createSymbol

      public RubySymbol createSymbol(String name, boolean hard)
      Create a new symbol without looking for an existing one. Primarily used for core symbols used repeatedly from Java. Use only when you know there is no existing symbol.
      Parameters:
      name - name of the symbol
      hard - whether to mark it as a hard reference
      Returns:
      a new symbol after inserting it into the symbol table
    • getSymbol

      public RubySymbol getSymbol(ByteList bytes)
    • getSymbol

      public RubySymbol getSymbol(ByteList bytes, boolean hard)
    • getSymbol

      public RubySymbol getSymbol(ByteList bytes, RubySymbol.ObjBooleanConsumer<RubySymbol> handler, boolean hard)
      Get or retrieve an existing symbol from the table, invoking the given handler before return. In the case of a new symbol, the handler will be invoked before the symbol is registered, so it can be manipulated without leaking changes.
      Parameters:
      bytes - the symbol bytes
      handler - the handler to invoke
      hard - whether to hold a hard reference to the symbol
      Returns:
      the new or existing symbol
    • getMethodSymbolFromCompound

      public RubySymbol getMethodSymbolFromCompound(String compoundName)
      Get the method name symbol from a compound name.
      Parameters:
      compoundName - the compound name
      Returns:
      the method component of the compound name, as a symbol
      See Also:
      • getCompoundSymbol(String)
    • getCalleeSymbolFromCompound

      public RubySymbol getCalleeSymbolFromCompound(String compoundName)
      Get the callee name symbol from a compound name.
      Parameters:
      compoundName - the compound name
      Returns:
      the callee component of the compound name, as a symbol
      See Also:
      • getCompoundSymbol(String)
    • fastGetSymbol

      public RubySymbol fastGetSymbol(String internedName)
    • fastGetSymbol

      public RubySymbol fastGetSymbol(String internedName, boolean hard)
    • getEncodingSymbolE

      public RubySymbol getEncodingSymbolE()
    • getEncodingSymbol

      public RubySymbol getEncodingSymbol()
    • lookup

      public RubySymbol lookup(long id)
    • all_symbols

      @Deprecated(since="10.0") public RubyArray all_symbols()
      Deprecated.
    • all_symbols

      public RubyArray all_symbols(ThreadContext context)
    • size

      public int size()
    • clear

      public void clear()
    • lookup

      @Deprecated public RubySymbol lookup(String name)
      Deprecated.
    • store

      @Deprecated public void store(RubySymbol symbol)
      Deprecated.