public abstract class SymbolTable
extends java.lang.Object
A symbol table keeps a list of instances of Symbol, each one with a unique pair class
/ name. Tables have one main attribute: a package name. This should be unique and are used to
generate the R.java file.
| Modifier and Type | Class and Description |
|---|---|
static class |
SymbolTable.Builder
Builder that creates a symbol table.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
R_CLASS_NAME
Name of
R class. |
| Constructor and Description |
|---|
SymbolTable() |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.collect.ImmutableCollection<Symbol> |
allSymbols()
Obtains all symbols in the table.
|
static SymbolTable.Builder |
builder()
Creates a new builder to create a
SymbolTable. |
boolean |
contains(com.android.resources.ResourceType resourceType,
java.lang.String name)
Checks if the table contains a symbol with the given resource type / name.
|
SymbolTable |
filter(SymbolTable table)
Produces a subset of this symbol table that has the symbols with resource type / name defined
in
filter. |
abstract com.google.common.collect.ImmutableMap<java.lang.String,Symbol> |
getSymbols() |
abstract java.lang.String |
getTablePackage()
Obtains the table package.
|
static java.lang.String |
key(com.android.resources.ResourceType resourceType,
java.lang.String name)
Obtains a unique key for a resource type / name.
|
static SymbolTable |
merge(java.util.List<SymbolTable> tables)
Merges a list of tables into a single table.
|
SymbolTable |
merge(SymbolTable m)
Short for merging
this and m. |
SymbolTable |
rename(java.lang.String tablePackage)
Builds a new symbol table that has the same symbols as this one, but was renamed with
the given package.
|
public static final java.lang.String R_CLASS_NAME
R class.@NonNull public abstract java.lang.String getTablePackage()
public abstract com.google.common.collect.ImmutableMap<java.lang.String,Symbol> getSymbols()
@NonNull
public static java.lang.String key(@NonNull
com.android.resources.ResourceType resourceType,
@NonNull
java.lang.String name)
resourceType - the resource typename - the namepublic boolean contains(@NonNull
com.android.resources.ResourceType resourceType,
@NonNull
java.lang.String name)
resourceType - the resource typename - the name@NonNull public com.google.common.collect.ImmutableCollection<Symbol> allSymbols()
@NonNull public SymbolTable filter(@NonNull SymbolTable table)
filter. In other words, a symbol s will exist in the result if and only
if s exists in this and there is a symbol s1 in table
such that s.resourceType == s1.resourceType && s.name == s1.name.table - the filter table@NonNull public SymbolTable merge(@NonNull SymbolTable m)
this and m.m - the table to add to thisthis with m@NonNull public SymbolTable rename(@NonNull java.lang.String tablePackage)
tablePackage - the table package@NonNull public static SymbolTable merge(@NonNull java.util.List<SymbolTable> tables)
tables - the tables to mergetables, or the default one if there are no tables in
tables@NonNull public static SymbolTable.Builder builder()
SymbolTable.