public final class Embedding extends Object
Embedding compoundEmbedding = Embedding.create (Arrays.asList (new Source[] { snapshot.create ("some prefix code", "text/x-java"), snapshot.create (10, 100, "text/x-java"), snapshot.create ("some postfix code", "text/x-java") })));
Modifier and Type | Method and Description |
---|---|
boolean |
containsOriginalOffset(int originalOffset)
Returns
true if this embedding contains given offset related
to top level source. |
static Embedding |
create(List<Embedding> embeddings)
Creates
Embedding from a list of embeddings. |
String |
getMimeType()
Returns mime type of embedded source.
|
Snapshot |
getSnapshot()
Returns
Snapshot for embedded block of code. |
String |
toString() |
public static Embedding create(List<Embedding> embeddings)
Embedding
from a list of embeddings. All embeddings
have to be created from one Smapshot. All embeddings must have the same
mime type, but this mime type have to be different than current
embedding mime types.embeddings
- A list of some embeddings created from one source.IllegalArgumentException
- if embeddings collection is empty, or
mime types of embeddings are not same.NullPointerException
- embedding is null.public final Snapshot getSnapshot()
Snapshot
for embedded block of code.Snapshot
for embedded block of code..public final String getMimeType()
public final boolean containsOriginalOffset(int originalOffset)
true
if this embedding contains given offset related
to top level source.originalOffset
- A offset in original source.true
if this embedding contains given offset