Top Description Fields Constructors Methods
org.eclipse.jgit.diff

public Class HashedSequencePair<S extends Sequence>

extends Object
Class Inheritance
Type Parameters
<S>
the base sequence type.

Wraps two org.eclipse.jgit.diff.Sequence instances to cache their element hash codes.

This pair wraps two sequences that contain cached hash codes for the input sequences.

Field Summary

Modifier and TypeField and Description
private final S
private final S
private HashedSequence<S>
private HashedSequence<S>
private final SequenceComparator<? super S>

Constructor Summary

AccessConstructor and Description
public
HashedSequencePair(SequenceComparator<? super S>
the base comparator for the sequence elements.
cmp
,
S
the A sequence.
a
,
S
the B sequence.
b
)

Construct a pair to provide fast hash codes.

Method Summary

Modifier and TypeMethod and Description
public HashedSequence<S>

Returns:

wrapper around A that includes cached hash codes
getA
()

Get A

public HashedSequence<S>

Returns:

wrapper around B that includes cached hash codes
getB
()

Get B

public HashedSequenceComparator<S>

Returns:

obtain a comparator that uses the cached hash codes
getComparator
()

Get comparator

private HashedSequence<S>
wrap(S base)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseAback to summary
private final S baseA
baseBback to summary
private final S baseB
cachedAback to summary
private HashedSequence<S> cachedA
cachedBback to summary
private HashedSequence<S> cachedB
cmpback to summary
private final SequenceComparator<? super S> cmp

Constructor Detail

HashedSequencePairback to summary
public HashedSequencePair(SequenceComparator<? super S> cmp, S a, S b)

Construct a pair to provide fast hash codes.

Parameters
cmp:SequenceComparator<? super S>

the base comparator for the sequence elements.

a:S

the A sequence.

b:S

the B sequence.

Method Detail

getAback to summary
public HashedSequence<S> getA()

Get A

Returns:HashedSequence<S>

wrapper around A that includes cached hash codes

getBback to summary
public HashedSequence<S> getB()

Get B

Returns:HashedSequence<S>

wrapper around B that includes cached hash codes

getComparatorback to summary
public HashedSequenceComparator<S> getComparator()

Get comparator

Returns:HashedSequenceComparator<S>

obtain a comparator that uses the cached hash codes

wrapback to summary
private HashedSequence<S> wrap(S base)