public final class ResourceTable extends NamespaceAwareTable<com.android.resources.ResourceType,com.google.common.collect.ListMultimap<java.lang.String,ResourceItem>>
ResourceItem
, indexed by components of a
ResourceUrl
.
The first dimension is namespace. Can be taken straight from ResourceUrl
.
The second dimension is the type of resources in question.
The value is a multimap that maps resource name (third dimension) to all matching ResourceItem
s. There can be multiple items defined under the same name with different resource
qualifiers.
NamespaceAwareTable
,
FolderConfiguration
,
ResourceQualifier
Constructor and Description |
---|
ResourceTable() |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ListMultimap<java.lang.String,ResourceItem> |
getOrPutEmpty(java.lang.String namespace,
com.android.resources.ResourceType resourceType)
Gets the corresponding multimap from the table, if necessary creating an empty one and
putting it in the table.
|
void |
remove(ResourceItem resourceItem)
Removes the given
ResourceItem from the table, making sure no empty multimaps are
left as Table values. |
void |
update(ResourceMerger merger)
Updates this
ResourceTable by listening to events emitted by the ResourceMerger . |
contains, containsRow, delegate, get, put, remove, row, rowKeySet
public void remove(ResourceItem resourceItem)
ResourceItem
from the table, making sure no empty multimaps are
left as Table
values. This way the set of rows and columns we get from the Table
reflects reality.@NonNull public com.google.common.collect.ListMultimap<java.lang.String,ResourceItem> getOrPutEmpty(@Nullable java.lang.String namespace, @NonNull com.android.resources.ResourceType resourceType)
public void update(ResourceMerger merger)
ResourceTable
by listening to events emitted by the ResourceMerger
.
Only makes sense for a newly created ResourceTable
or if the table was initialized
by the same ResourceMerger
before.