public final class SmallDefinitionStore4 extends SmallDefinitionStoreBase
IDefinitionStore for storing
up to 4 definitions using 4 fields rather than a map.
Many scopes contain only a few definitions.
The methods of this class are optimized to use unrolled loops.
EMPTY_STRING_ARRAY| Constructor and Description |
|---|
SmallDefinitionStore4()
Constructor.
|
SmallDefinitionStore4(SmallDefinitionStore2 other)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IDefinitionStore |
createLargerStore()
Creates another definition store with a greater capacity.
|
protected int |
findAvailableIndex()
Returns the index of the first null field where a new definition set
can be stored.
|
protected int |
findIndexForBaseName(String baseName)
Returns the index of the field storing a definition set with the
specified base name, or -1 if there is no such field.
|
Collection<IDefinition> |
getAllDefinitions()
Gets all the definitions in this store.
|
Collection<IDefinitionSet> |
getAllDefinitionSets()
Gets all the definitions sets in this store.
|
Collection<String> |
getAllNames()
Gets the base names of all the definition sets in this store.
|
int |
getCapacity()
Gets the number of fields for storing definition sets.
|
protected IDefinitionSet |
getDefinitionSet(int i)
Gets the definition set stored in the specified field.
|
IDefinitionSet |
getDefinitionSetByName(String baseName)
Gets the set of definitions in this store that have a specified base name.
|
void |
putDefinitionSetByName(String baseName,
IDefinitionSet set)
Puts a specified set of definitions with a specified base name
into this store.
|
protected void |
setDefinitionSet(int i,
IDefinitionSet definitionSet)
Sets the specified definition set into the specified field.
|
add, addBaseNameToList, addDefinitionSetToList, addDefinitionsToList, addDefinitionToSet, getBaseName, remove, removeDefinitionFromSet, toStringpublic SmallDefinitionStore4()
public SmallDefinitionStore4(SmallDefinitionStore2 other)
public int getCapacity()
SmallDefinitionStoreBasegetCapacity in interface IDefinitionStoregetCapacity in class SmallDefinitionStoreBasepublic IDefinitionStore createLargerStore()
IDefinitionStore
When a call to IDefinitionStore.add(org.apache.flex.compiler.definitions.IDefinition)() on this store returns false
(because the store has reached its capacity), call this method
to create a larger store and then call add()) on it.
The second add() is guaranteed to succeed.
IDefinitionStore with a greater capacity.public IDefinitionSet getDefinitionSetByName(String baseName)
IDefinitionStoreThis method is called very frequently as part of name resolution. All implementations should be fast and avoid creating temporary objects.
getDefinitionSetByName in interface IDefinitionStoregetDefinitionSetByName in class SmallDefinitionStoreBasebaseName - The base name of the definitions you want to retrieve
from the store.IDefinitionSet containing the definition with that
base name, or null if there are none.public void putDefinitionSetByName(String baseName, IDefinitionSet set)
IDefinitionStoreThis is only used when a project scope has to replace a definition set in its store because it has converted definition promises in the set to actual definitions.
baseName - The base name of the definitions in the set.set - The IDefinitionSet of definitions to put
into the store.public Collection<String> getAllNames()
IDefinitionStorepublic Collection<IDefinitionSet> getAllDefinitionSets()
IDefinitionStoreIDefinitionSet objects.public Collection<IDefinition> getAllDefinitions()
IDefinitionStoreIDefinition objects.protected int findIndexForBaseName(String baseName)
SmallDefinitionStoreBasefindIndexForBaseName in class SmallDefinitionStoreBasebaseName - The base name to look for.protected int findAvailableIndex()
SmallDefinitionStoreBasefindAvailableIndex in class SmallDefinitionStoreBaseprotected IDefinitionSet getDefinitionSet(int i)
SmallDefinitionStoreBasegetDefinitionSet in class SmallDefinitionStoreBasei - The index of the field.IDefinitionSet store there.protected void setDefinitionSet(int i,
IDefinitionSet definitionSet)
SmallDefinitionStoreBasesetDefinitionSet in class SmallDefinitionStoreBasei - The index of the field.definitionSet - The IDefinitionSet to store there.Copyright © 2016 The Apache Software Foundation. All rights reserved.