Package org.eclipse.emf.common.util
Class SegmentSequence.StringArrayPool.SegmentsAndSubsegmentAccessUnit
java.lang.Object
org.eclipse.emf.common.util.Pool.AccessUnit<String[]>
org.eclipse.emf.common.util.SegmentSequence.StringArrayPool.AccessUnitBase
org.eclipse.emf.common.util.SegmentSequence.StringArrayPool.SegmentsAndSubsegmentAccessUnit
- Enclosing class:
- SegmentSequence.StringArrayPool
protected static class SegmentSequence.StringArrayPool.SegmentsAndSubsegmentAccessUnit
extends SegmentSequence.StringArrayPool.AccessUnitBase
An access unit for accessing segments and a substring of one additional segment.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe number of characters from the offset.protected intThe offset within the segment.protected StringThe one additional segment.protected intThe number of segments to consider.protected intHash code of character range of the additional segment.protected String[]The segments being accessed.Fields inherited from class org.eclipse.emf.common.util.SegmentSequence.StringArrayPool.AccessUnitBase
stringAccessUnit, substringAccessUnitFields inherited from class org.eclipse.emf.common.util.Pool.AccessUnit
createdEntry, entries, hashCode, matchingIndex, next, queue, values, valuesLength -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSegmentsAndSubsegmentAccessUnit(SegmentSequence.StringArrayPool.SegmentsAndSubsegmentAccessUnit.Queue queue) Creates an instance managed by the given queue. -
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the value that should be added to the pool.protected booleanUsed 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 voidsetValue(int hashCode, String[] segments, int segmentCount, String segment, int offset, int count, int segmentHashCode) Caches the parameters and computes the hash code.protected voidsetValue(String[] segments, int segmentCount, String segment, int offset, int count, int segmentHashCode) Caches the parameters and computes the hash code.Methods inherited from class org.eclipse.emf.common.util.SegmentSequence.StringArrayPool.AccessUnitBase
getValue, internString, internString, setArbitraryValue, setValueMethods inherited from class org.eclipse.emf.common.util.Pool.AccessUnit
add, getEntry, match, rematches
-
Field Details
-
segments
The segments being accessed. -
segmentCount
protected int segmentCountThe number of segments to consider. -
segment
The one additional segment. -
offset
protected int offsetThe offset within the segment. -
count
protected int countThe number of characters from the offset. -
segmentHashCode
protected int segmentHashCodeHash code of character range of the additional segment.
-
-
Constructor Details
-
SegmentsAndSubsegmentAccessUnit
protected SegmentsAndSubsegmentAccessUnit(SegmentSequence.StringArrayPool.SegmentsAndSubsegmentAccessUnit.Queue queue) Creates an instance managed by the given queue.
-
-
Method Details
-
setValue
protected void setValue(int hashCode, String[] segments, int segmentCount, String segment, int offset, int count, int segmentHashCode) Caches the parameters and computes the hash code. -
setValue
protected void setValue(String[] segments, int segmentCount, String segment, int offset, int count, int segmentHashCode) Caches the parameters and computes the hash code. -
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 classSegmentSequence.StringArrayPool.AccessUnitBase
-
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<String[]>
-
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<String[]>
-