use of org.eclipse.xtext.xbase.lib.ExclusiveRange in project xtext-core by eclipse.
the class ChunkedResourceDescriptions method readExternal.
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
final int numChunks = in.readInt();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, numChunks, true);
for (final Integer i : _doubleDotLessThan) {
{
final String chunkName = in.readUTF();
final int numDescriptions = in.readInt();
final ArrayList<IResourceDescription> descriptions = new ArrayList<IResourceDescription>(numDescriptions);
ExclusiveRange _doubleDotLessThan_1 = new ExclusiveRange(0, numDescriptions, true);
for (final Integer j : _doubleDotLessThan_1) {
Object _readObject = in.readObject();
descriptions.add(((IResourceDescription) _readObject));
}
ResourceDescriptionsData _resourceDescriptionsData = new ResourceDescriptionsData(descriptions);
this.chunk2resourceDescriptions.put(chunkName, _resourceDescriptionsData);
}
}
}
use of org.eclipse.xtext.xbase.lib.ExclusiveRange in project xtext-core by eclipse.
the class SerializableResourceDescription method readExternal.
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
this.setURI(SerializationExtensions.readURI(in));
final int descriptionsSize = in.readInt();
ArrayList<SerializableEObjectDescription> _arrayList = new ArrayList<SerializableEObjectDescription>(descriptionsSize);
this.descriptions = _arrayList;
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, descriptionsSize, true);
for (final Integer i : _doubleDotLessThan) {
this.descriptions.add(SerializationExtensions.<SerializableEObjectDescription>readCastedObject(in));
}
final int referencesSize = in.readInt();
ArrayList<SerializableReferenceDescription> _arrayList_1 = new ArrayList<SerializableReferenceDescription>(referencesSize);
this.references = _arrayList_1;
ExclusiveRange _doubleDotLessThan_1 = new ExclusiveRange(0, referencesSize, true);
for (final Integer i_1 : _doubleDotLessThan_1) {
this.references.add(SerializationExtensions.<SerializableReferenceDescription>readCastedObject(in));
}
final int importedNamesSize = in.readInt();
ArrayList<QualifiedName> _arrayList_2 = new ArrayList<QualifiedName>(importedNamesSize);
this.importedNames = _arrayList_2;
ExclusiveRange _doubleDotLessThan_2 = new ExclusiveRange(0, importedNamesSize, true);
for (final Integer i_2 : _doubleDotLessThan_2) {
this.importedNames.add(SerializationExtensions.readQualifiedName(in));
}
}
use of org.eclipse.xtext.xbase.lib.ExclusiveRange in project xtext-core by eclipse.
the class SerializableResourceDescriptionTest method assertDescriptionsEqual.
public void assertDescriptionsEqual(final SerializableResourceDescription before, final SerializableResourceDescription after) {
Assert.assertEquals(before.getURI(), after.getURI());
Assert.assertEquals(before.getImportedNames(), after.getImportedNames());
Assert.assertEquals(before.getReferences().size(), after.getReferences().size());
int _size = before.getReferences().size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final int i : _doubleDotLessThan) {
{
final SerializableReferenceDescription beforeRef = before.getReferences().get(i);
final SerializableReferenceDescription afterRef = after.getReferences().get(i);
Assert.assertEquals(beforeRef.getContainerEObjectURI(), afterRef.getContainerEObjectURI());
Assert.assertEquals(beforeRef.getSourceEObjectUri(), afterRef.getSourceEObjectUri());
Assert.assertEquals(beforeRef.getTargetEObjectUri(), afterRef.getTargetEObjectUri());
Assert.assertEquals(beforeRef.getEReference(), afterRef.getEReference());
Assert.assertEquals(beforeRef.getIndexInList(), afterRef.getIndexInList());
}
}
Assert.assertEquals(before.getDescriptions().size(), after.getDescriptions().size());
int _size_1 = before.getDescriptions().size();
ExclusiveRange _doubleDotLessThan_1 = new ExclusiveRange(0, _size_1, true);
for (final int i_1 : _doubleDotLessThan_1) {
{
final SerializableEObjectDescription beforeDesc = before.getDescriptions().get(i_1);
final SerializableEObjectDescription afterDesc = after.getDescriptions().get(i_1);
Assert.assertEquals(beforeDesc.getEClass(), afterDesc.getEClass());
Assert.assertEquals(beforeDesc.getName(), afterDesc.getName());
Assert.assertEquals(beforeDesc.qualifiedName, afterDesc.qualifiedName);
Assert.assertEquals(beforeDesc.userData, afterDesc.userData);
Assert.assertEquals(beforeDesc.getEObjectURI(), afterDesc.getEObjectURI());
}
}
}
use of org.eclipse.xtext.xbase.lib.ExclusiveRange in project xtext-core by eclipse.
the class DefaultTaskFinderTest method assertContainsTasks.
private void assertContainsTasks(final Resource resource, final List<Task> expectedTasks) {
final List<Task> actualTasks = this.finder.findTasks(resource);
Assert.assertEquals(expectedTasks.size(), actualTasks.size());
int _size = expectedTasks.size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final Integer i : _doubleDotLessThan) {
TaskAssert.assertExactMatch(expectedTasks.get((i).intValue()), actualTasks.get((i).intValue()));
}
}
use of org.eclipse.xtext.xbase.lib.ExclusiveRange in project xtext-core by eclipse.
the class DefaultTaskParserTest method testLongInputManyTasks.
@Test
public void testLongInputManyTasks() {
final int expectation = 100000;
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*");
_builder.newLine();
{
IntegerRange _upTo = new IntegerRange(1, expectation);
for (final Integer i : _upTo) {
_builder.append(" ");
_builder.append("* FIXME this cannot work");
_builder.newLine();
}
}
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
final String source = _builder.toString();
final List<Task> parsed = this.parser.parseTasks(LineDelimiters.toUnix(source), this.definitions);
Assert.assertEquals(expectation, parsed.size());
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, expectation, true);
for (final Integer i_1 : _doubleDotLessThan) {
Assert.assertEquals(((i_1).intValue() + 2), parsed.get((i_1).intValue()).getLineNumber());
}
}
Aggregations