Package org.eclipse.emf.common.util
Class SegmentSequence.SegmentSequencePool.StringAccessUnit
java.lang.Object
org.eclipse.emf.common.util.Pool.AccessUnit<SegmentSequence>
org.eclipse.emf.common.util.SegmentSequence.SegmentSequencePool.AccessUnitBase
org.eclipse.emf.common.util.SegmentSequence.SegmentSequencePool.StringAccessUnit
- Enclosing class:
SegmentSequence.SegmentSequencePool
protected static class SegmentSequence.SegmentSequencePool.StringAccessUnit
extends SegmentSequence.SegmentSequencePool.AccessUnitBase
An access unit for basic string access.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char[]A buffer for character level processing; it grows as needed.An access unit for exclusive use ininternString(char[], int, int, int).protected StringThe delimiter of the value being accessed.protected char[]A buffer to hold the delimiter's characters; it grows as needed.protected String[]A buffer for building up string segments; it grows as needed.protected StringThe value being access.Fields inherited from class org.eclipse.emf.common.util.Pool.AccessUnit
createdEntry, entries, hashCode, matchingIndex, next, queue, values, valuesLength -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate an instance managed by the given queue. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidensureSegmentCapacity(int segmentCount) Ensures that the segment buffer is give enough to hold the given number of segments.Gets the value that should be added to the pool.protected StringinternString(char[] characters, int offset, int count, int hashCode) protected booleanmatches(SegmentSequence value) Used to determine whether the given value from the pool is equal to the value being accessed.voidreset(boolean isExclusive) Prepare the access unit for reuse.protected voidRecords the parameters and computes the hash code.Methods inherited from class org.eclipse.emf.common.util.SegmentSequence.SegmentSequencePool.AccessUnitBase
getValue, hashCode, setArbitraryValue, setValueMethods inherited from class org.eclipse.emf.common.util.Pool.AccessUnit
add, getEntry, match, rematches
-
Field Details
-
buffer
protected char[] bufferA buffer for character level processing; it grows as needed. -
delimiterBuffer
protected char[] delimiterBufferA buffer to hold the delimiter's characters; it grows as needed. -
segmentBuffer
A buffer for building up string segments; it grows as needed. -
delimiter
The delimiter of the value being accessed. -
string
The value being access. -
charactersAccessUnit
An access unit for exclusive use ininternString(char[], int, int, int).
-
-
Constructor Details
-
StringAccessUnit
Create an instance managed by the given queue.
-
-
Method Details
-
internString
-
setValue
Records the parameters and computes the hash code. -
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<SegmentSequence>
-
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<SegmentSequence>
-
ensureSegmentCapacity
protected void ensureSegmentCapacity(int segmentCount) Ensures that the segment buffer is give enough to hold the given number of segments. -
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 classPool.AccessUnit<SegmentSequence>
-