eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Diff2::Chunk':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Chunk (private in Diff2

This class is only visible from within Diff2.

Inheritance:

   Object
   |
   +--Diff2::Chunk

Package:
stx:libtool
Category:
Collections-Sequenceable-Diff
Owner:
Diff2
Author:
Tony Garnock-Jones <tonyg@lshift.com>

Description:


A DiffChunk represents a span of items within a collection (e.g. a collection of lines representing a text file).

Instance Variables
    length:                 <Integer> Count of lines within the chunk; 0 is permitted
    offset:                 <Integer> Index of first line within the chunk; 1-based


[instance variables:]

[class variables:]


Related information:



Class protocol:

as yet unclassified
o  negativeSize: s
Returns a pseudo-chunk with *negative* length, useful as a kind of zero for destructiveMergeWith: operations intended to build up coverage over some set of chunks.

o  offset: o length: l


Instance protocol:

accessing
o  correctForSkewFrom: smallerChunk to: biggerChunk
Given a biggerChunk that definitely contains smallerChunk but might have an extra head or tail, updates the receiver to include such an extra head or tail.

o  destructiveMergeWith: aChunk

o  lastIndex
Returns the rightmost index contained in my range. (Offset is the leftmost index.) If my length is zero, will return an index lower than my offset.

o  length

o  length: anObject

o  offset

o  offset: anObject

o  printOn: aStream

as yet unclassified
o  extractFrom: aCollection
Extracts a subcollection from aCollection corresponding to my offset and length.

o  extractSafeFrom: aCollection
Extracts a subcollection from aCollection corresponding to my offset and length.
Returns nil if extraction fails (out of bounds)

comparing
o  < aDiffChunk
Used to sort changed chunks during three-way merge; see Diff3

o  = otherChunk
(comment from inherited method)
return true if the receiver and the arg have the same structure.
Notice:
This method is partially open coded (inlined) by the compiler(s)
identical objects are always considered equal.
redefining it may not work as expected.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 27 Apr 2024 01:04:02 GMT