|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A sequence of 1D spans (assumed to be the same type, but not enforced) that can be operated on as a string for cuttings.
2D (image) or 3D (video/page) spans can be included in the streams: those which do not extend Span1D they are interpreted as single characters by this class, but those that do are interpreted as text of their length. In the text string, they are represented by the character (XXX? Not sure yet). The Iterator returned by the iterator() method will iterate over those spans normally.
NOTE: THIS IS AN IMMUTABLE CLASS: NEW OBJECTS ARE CREATED BY THE OPERATIONS. A tree implementation should be able to share nodes and thus perform operations with log(L) efficiency.
Nested Class Summary | |
static interface |
Enfilade1D.Maker
|
Field Summary | |
static java.lang.String |
rcsid
|
Method Summary | |
java.util.List |
getList()
Get a List of the spans in this enfilade. |
Enfilade1D.Maker |
getMaker()
|
int |
length()
Get the sum of the lengths. |
java.lang.String |
makeString()
Return a String object where offsets are the same as in this enfilade. |
Enfilade1D |
optimized()
Return a possibly optimized version of this enfilade. |
Enfilade1D |
plus(Enfilade1D other)
Return an Enfilade1D object whose vstream is a concatenation of this enfilade and the other one given. |
Enfilade1D |
plus(Span1D other)
Return an Enfilade1D object whose vstream is a concatenation of this enfilade and the span given. |
Enfilade1D |
prepended(Span1D other)
Return an Enfilade1D object whose vstream is a concatenation of the given span and this enfilade. |
Enfilade1D |
sub(int o1)
|
Enfilade1D |
sub(int o1,
int o2)
|
Field Detail |
public static final java.lang.String rcsid
Method Detail |
public Enfilade1D.Maker getMaker()
public int length()
public Enfilade1D sub(int o1)
public Enfilade1D sub(int o1, int o2)
public Enfilade1D plus(Enfilade1D other)
public Enfilade1D plus(Span1D other)
public Enfilade1D prepended(Span1D other)
public java.lang.String makeString()
This is not toString() because that routine will give a string which explicitly indicates that this is an enfilade, and also gives the permanent ids of the spans therein.
public java.util.List getList()
public Enfilade1D optimized()
It is at its most useful for enfilades that have been created by adding little by little to the end, and which are not shared. Of course, most text entered in cells *is* just like that...
This method must at least join spans which are next to each other and which are contiguous (the latter can be appended to the former). This is necessary because coniguous spans MUST be appended before saving, otherwise we'd generate lots of JUNK!
Invariants which implementations MUST obey: ( XXX too harsh? )
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |