Package org.eclipse.emf.common.util
Class URI.URIPool.StringAccessUnit
java.lang.Object
org.eclipse.emf.common.util.Pool.AccessUnit<URI>
org.eclipse.emf.common.util.URI.URIPool.URIPoolAccessUnitBase
org.eclipse.emf.common.util.URI.URIPool.StringAccessUnit
- Enclosing class:
- URI.URIPool
An access unit for basic string access.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe cached hash code computed byfindMajorSeparator(int, String, int)andfindSegmentEnd(int, String, int).protected charThe cached terminating character computed byfindMajorSeparator(int, String, int)andfindSegmentEnd(int, String, int).protected final URI.URIPoolThis unit's pool.An access unit for exclusive use ininternArray(int, String[], int, String, int, int, int).An access unit for exclusive use ininternArray(String, int, int, int).protected StringThe value being accessed.Fields inherited from class org.eclipse.emf.common.util.URI.URIPool.URIPoolAccessUnitBase
charactersAccessUnit, stringAccessUnit, stringArraySegmentsAndSegmentCountAccessUnit, stringPoolEntry, substringAccessUnitFields inherited from class org.eclipse.emf.common.util.Pool.AccessUnit
createdEntry, entries, hashCode, matchingIndex, next, queue, values, valuesLength -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an instance managed by this queue and pool. -
Method Summary
Modifier and TypeMethodDescriptionprotected intfindMajorSeparator(int length, String s, int i) Looks for a '/', ':', or '?', computing thehash codeandsetting the characterthat terminated the scan.protected intfindSegmentEnd(int length, String s, int i) Looks for a '/', or '?', computing thehash codeandsetting the characterthat terminated the scan.Gets the value that should be added to the pool.protected String[]internArray(int hashCode, String[] segments, int segmentCount, String segment, int offset, int count, int segmentHashCode) protected String[]internArray(String segment, int offset, int count, int hashCode) match()Used to return a value from among thePool.AccessUnit.valuesthatPool.AccessUnit.matches(Object)the value being accessed.protected booleanUsed to determine whether the given value from the pool is equal to the value being accessed.protected URIparseIntoURI(String uri) A string-parsing implementation.voidreset(boolean isExclusive) Prepare the access unit for reuse.protected voidCaches the parameters.protected voidCaches the parameters.Methods inherited from class org.eclipse.emf.common.util.URI.URIPool.URIPoolAccessUnitBase
getValue, intern, intern, intern, intern, intern, intern, internArray, setArbitraryValue, setValueMethods inherited from class org.eclipse.emf.common.util.Pool.AccessUnit
add, getEntry, rematches
-
Field Details
-
pool
This unit's pool. -
value
The value being accessed. -
findHashCode
protected int findHashCodeThe cached hash code computed byfindMajorSeparator(int, String, int)andfindSegmentEnd(int, String, int). -
findTerminatingCharacter
protected char findTerminatingCharacterThe cached terminating character computed byfindMajorSeparator(int, String, int)andfindSegmentEnd(int, String, int). -
stringArraySubstringAccessUnit
An access unit for exclusive use ininternArray(String, int, int, int). -
stringArraySegmentsAndSubsegmentAccessUnit
protected SegmentSequence.StringArrayPool.SegmentsAndSubsegmentAccessUnit stringArraySegmentsAndSubsegmentAccessUnitAn access unit for exclusive use ininternArray(int, String[], int, String, int, int, int).
-
-
Constructor Details
-
StringAccessUnit
Creates an instance managed by this queue and pool.
-
-
Method Details
-
internArray
-
internArray
-
setValue
Caches the parameters. -
setValue
Caches the parameters. -
matches
Description copied from class:Pool.AccessUnitUsed to determine whether the given value from the pool is equal to the value being accessed. The default implementation usesObject.equals(Object).- Overrides:
matchesin classPool.AccessUnit<URI>
-
match
Description copied from class:Pool.AccessUnitUsed to return a value from among thePool.AccessUnit.valuesthatPool.AccessUnit.matches(Object)the value being accessed. Returnsnullif there is no such matching value.- Overrides:
matchin classPool.AccessUnit<URI>
-
getInternalizedValue
Description copied from class:Pool.AccessUnitGets the value that should be added to the pool. This can be specialized to internalized the value, e.g., to make a copy that uses minimal storage or is read only.- Overrides:
getInternalizedValuein classPool.AccessUnit<URI>
-
parseIntoURI
A string-parsing implementation. This method creates instances in the pool as a side-effect. Note that we never pass in a string with a fragment separator to this method. -
findMajorSeparator
Looks for a '/', ':', or '?', computing thehash codeandsetting the characterthat terminated the scan. -
findSegmentEnd
Looks for a '/', or '?', computing thehash codeandsetting the characterthat terminated the scan. -
reset
public void reset(boolean isExclusive) Description copied from class:Pool.AccessUnitPrepare the access unit for reuse. In particular remove the hard references to each element in both thePool.AccessUnit.valuesandPool.AccessUnit.entriesand then reset thePool.AccessUnit.valuesLengthto 0- Overrides:
resetin classURI.URIPool.URIPoolAccessUnitBase
-