本文整理汇总了Java中org.eclipse.xtext.xbase.lib.ExclusiveRange类的典型用法代码示例。如果您正苦于以下问题:Java ExclusiveRange类的具体用法?Java ExclusiveRange怎么用?Java ExclusiveRange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExclusiveRange类属于org.eclipse.xtext.xbase.lib包,在下文中一共展示了ExclusiveRange类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toTypeReference
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
protected JvmTypeReference toTypeReference(final JvmType type, final int arrayDimensions) {
if ((type == null)) {
return null;
}
JvmParameterizedTypeReference _createJvmParameterizedTypeReference = TypesFactory.eINSTANCE.createJvmParameterizedTypeReference();
final Procedure1<JvmParameterizedTypeReference> _function = (JvmParameterizedTypeReference it) -> {
it.setType(type);
};
JvmTypeReference resultTypeRef = ObjectExtensions.<JvmParameterizedTypeReference>operator_doubleArrow(_createJvmParameterizedTypeReference, _function);
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, arrayDimensions, true);
for (final Integer i : _doubleDotLessThan) {
{
final JvmGenericArrayTypeReference arrayRef = TypesFactory.eINSTANCE.createJvmGenericArrayTypeReference();
arrayRef.setComponentType(resultTypeRef);
resultTypeRef = arrayRef;
}
}
return resultTypeRef;
}
示例2: readExternal
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@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));
}
}
示例3: readExternal
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@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);
}
}
}
示例4: readExternal
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
final int numEntries = in.readInt();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, numEntries, true);
for (final Integer i : _doubleDotLessThan) {
{
final URI source = URI.createURI(in.readUTF());
final int numGenerated = in.readInt();
ExclusiveRange _doubleDotLessThan_1 = new ExclusiveRange(0, numGenerated, true);
for (final Integer j : _doubleDotLessThan_1) {
{
final URI generated = URI.createURI(in.readUTF());
final String outputConfig = in.readUTF();
this.addSource2Generated(source, generated, outputConfig);
}
}
}
}
}
示例5: someCodeGen
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
private StringConcatenationClient someCodeGen(final int n) {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
{
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, n, true);
for(final Integer i : _doubleDotLessThan) {
_builder.append("before ");
CompositeGeneratorNode _append = GeneratorNodeTest.this.exts.append(GeneratorNodeTest.this.exts.trace(GeneratorNodeTest.this.loc((10 + (i).intValue()))), "Hello");
_builder.append(_append);
_builder.append(" after");
_builder.newLineIfNotEmpty();
_builder.append(" ");
StringConcatenationClient _someCodeGen = GeneratorNodeTest.this.someCodeGen((n - 1));
_builder.append(_someCodeGen, " ");
_builder.newLineIfNotEmpty();
}
}
}
};
return _client;
}
示例6: someCodeGen_noTrace
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
private String someCodeGen_noTrace(final int n) {
StringConcatenation _builder = new StringConcatenation();
{
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, n, true);
for(final Integer i : _doubleDotLessThan) {
_builder.append("before ");
_builder.append("Hello");
_builder.append(" after");
_builder.newLineIfNotEmpty();
_builder.append(" ");
String _someCodeGen_noTrace = this.someCodeGen_noTrace((n - 1));
_builder.append(_someCodeGen_noTrace, " ");
_builder.newLineIfNotEmpty();
}
}
return _builder.toString();
}
示例7: testLongInputManyTasks
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@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());
}
}
示例8: getJointTransformations
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
public List<Pair<String, RelativeTransformation>> getJointTransformations() {
boolean _equals = Objects.equal(this.allTransformations, null);
if (_equals) {
LinkedList<Pair<String, RelativeTransformation>> _linkedList = new LinkedList<Pair<String, RelativeTransformation>>(this.jointTransformations);
this.allTransformations = _linkedList;
this.allTransformations.addAll(this.constraintTransformations);
List<Pair<String, List<JointMovement>>> _states = this.getStates();
int _size = _states.size();
int _size_1 = this.allTransformations.size();
int _minus = (_size - _size_1);
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _minus, true);
final Consumer<Integer> _function = new Consumer<Integer>() {
@Override
public void accept(final Integer it) {
ConnectiveTreeBuilder.this.allTransformations.add(null);
}
};
_doubleDotLessThan.forEach(_function);
}
return this.allTransformations;
}
示例9: schedule
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
public StringBuilder schedule(final List<Integer> threadLoad, final List<StringBuilder> threadExecution, final int costs, final CharSequence execution) {
StringBuilder _xblockexpression = null;
{
int min = Integer.MAX_VALUE;
int tid = (-1);
int _size = threadLoad.size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final Integer i : _doubleDotLessThan) {
{
final Integer load = threadLoad.get((i).intValue());
if (((load).intValue() <= min)) {
min = (load).intValue();
tid = (i).intValue();
}
}
}
Integer _get = threadLoad.get(tid);
int _plus = ((_get).intValue() + costs);
threadLoad.set(tid, Integer.valueOf(_plus));
_xblockexpression = threadExecution.get(tid).append(execution);
}
return _xblockexpression;
}
示例10: testContent
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@Test
public void testContent() {
Assert.assertEquals("1,2,3,4", IterableExtensions.join(new ExclusiveRange(1, 5, true), ","));
Assert.assertEquals("", IterableExtensions.join(new ExclusiveRange(0, 0, true), ","));
Assert.assertEquals("", IterableExtensions.join(new ExclusiveRange(0, (-1), true), ","));
Assert.assertEquals("-1", IterableExtensions.join(new ExclusiveRange((-1), 0, true), ","));
Assert.assertEquals("4,3,2,1", IterableExtensions.join(new ExclusiveRange(5, 1, false), ","));
Assert.assertEquals("", IterableExtensions.join(new ExclusiveRange(0, 0, false), ","));
Assert.assertEquals("", IterableExtensions.join(new ExclusiveRange((-1), 0, false), ","));
Assert.assertEquals("-1", IterableExtensions.join(new ExclusiveRange(0, (-1), false), ","));
}
示例11: testSize
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@Test
public void testSize() {
Assert.assertEquals(4, new ExclusiveRange(1, 5, true).size());
Assert.assertEquals(0, new ExclusiveRange(0, 0, true).size());
Assert.assertEquals(0, new ExclusiveRange(0, (-1), true).size());
Assert.assertEquals(1, new ExclusiveRange((-1), 0, true).size());
Assert.assertEquals(4, new ExclusiveRange(5, 1, false).size());
Assert.assertEquals(0, new ExclusiveRange(0, 0, false).size());
Assert.assertEquals(0, new ExclusiveRange((-1), 0, false).size());
Assert.assertEquals(1, new ExclusiveRange(0, (-1), false).size());
}
示例12: testIsEmpty
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@Test
public void testIsEmpty() {
Assert.assertFalse(new ExclusiveRange(1, 5, true).isEmpty());
Assert.assertTrue(new ExclusiveRange(0, 0, true).isEmpty());
Assert.assertTrue(new ExclusiveRange(0, (-1), true).isEmpty());
Assert.assertFalse(new ExclusiveRange((-1), 0, true).isEmpty());
Assert.assertFalse(new ExclusiveRange(5, 1, false).isEmpty());
Assert.assertTrue(new ExclusiveRange(0, 0, false).isEmpty());
Assert.assertTrue(new ExclusiveRange((-1), 0, false).isEmpty());
Assert.assertFalse(new ExclusiveRange(0, (-1), false).isEmpty());
}
示例13: testContains
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
@Test
public void testContains() {
Assert.assertFalse(new ExclusiveRange(1, 5, true).contains(0));
Assert.assertTrue(new ExclusiveRange(1, 5, true).contains(1));
Assert.assertTrue(new ExclusiveRange(1, 5, true).contains(2));
Assert.assertTrue(new ExclusiveRange(1, 5, true).contains(3));
Assert.assertTrue(new ExclusiveRange(1, 5, true).contains(4));
Assert.assertFalse(new ExclusiveRange(1, 5, true).contains(5));
Assert.assertFalse(new ExclusiveRange(0, 0, true).contains(0));
Assert.assertFalse(new ExclusiveRange(0, (-1), true).contains(0));
Assert.assertFalse(new ExclusiveRange(0, (-1), true).contains((-1)));
Assert.assertFalse(new ExclusiveRange((-1), 0, true).contains((-2)));
Assert.assertTrue(new ExclusiveRange((-1), 0, true).contains((-1)));
Assert.assertFalse(new ExclusiveRange((-1), 0, true).contains((-0)));
Assert.assertFalse(new ExclusiveRange(5, 1, false).contains(0));
Assert.assertTrue(new ExclusiveRange(5, 1, false).contains(1));
Assert.assertTrue(new ExclusiveRange(5, 1, false).contains(2));
Assert.assertTrue(new ExclusiveRange(5, 1, false).contains(3));
Assert.assertTrue(new ExclusiveRange(5, 1, false).contains(4));
Assert.assertFalse(new ExclusiveRange(5, 1, false).contains(5));
Assert.assertFalse(new ExclusiveRange(0, 0, false).contains(0));
Assert.assertFalse(new ExclusiveRange((-1), 0, false).contains(0));
Assert.assertFalse(new ExclusiveRange((-1), 0, false).contains((-1)));
Assert.assertFalse(new ExclusiveRange(0, (-1), false).contains((-2)));
Assert.assertTrue(new ExclusiveRange(0, (-1), false).contains((-1)));
Assert.assertFalse(new ExclusiveRange(0, (-1), false).contains((-0)));
}
示例14: parseTags
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
public static List<TaskTag> parseTags(final String names, final String priorities) {
final Splitter splitter = Splitter.on(",").omitEmptyStrings().trimResults();
final List<String> tags = IterableExtensions.<String>toList(splitter.split(names));
final List<String> prios = IterableExtensions.<String>toList(splitter.split(priorities));
final ArrayList<TaskTag> elements = CollectionLiterals.<TaskTag>newArrayList();
int _size = tags.size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final Integer i : _doubleDotLessThan) {
TaskTag _taskTag = new TaskTag();
final Procedure1<TaskTag> _function = (TaskTag it) -> {
it.setName(tags.get((i).intValue()));
Priority _xifexpression = null;
int _size_1 = prios.size();
boolean _greaterEqualsThan = (_size_1 >= (i).intValue());
if (_greaterEqualsThan) {
Priority _xtrycatchfinallyexpression = null;
try {
_xtrycatchfinallyexpression = Priority.valueOf(prios.get((i).intValue()));
} catch (final Throwable _t) {
if (_t instanceof IllegalArgumentException) {
_xtrycatchfinallyexpression = Priority.NORMAL;
} else {
throw Exceptions.sneakyThrow(_t);
}
}
_xifexpression = _xtrycatchfinallyexpression;
} else {
_xifexpression = Priority.NORMAL;
}
it.setPriority(_xifexpression);
};
TaskTag _doubleArrow = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function);
elements.add(_doubleArrow);
}
return elements;
}
示例15: assertContainsTasks
import org.eclipse.xtext.xbase.lib.ExclusiveRange; //导入依赖的package包/类
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()));
}
}