本文整理汇总了Java中org.eclipse.xtext.xbase.lib.IntegerRange类的典型用法代码示例。如果您正苦于以下问题:Java IntegerRange类的具体用法?Java IntegerRange怎么用?Java IntegerRange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntegerRange类属于org.eclipse.xtext.xbase.lib包,在下文中一共展示了IntegerRange类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: _generateArguments
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
private List<ParameterValueMapping> _generateArguments(final TAbstractMessages tMessage, final Operation operation, final Lifeline lifeline) {
List<ParameterValueMapping> _xblockexpression = null;
{
final List<ParameterValueMapping> result = CollectionLiterals.<ParameterValueMapping>newArrayList();
EList<Parameter> _parameters = operation.getParameters();
boolean _isEmpty = _parameters.isEmpty();
boolean _equals = (_isEmpty == false);
if (_equals) {
EList<Parameter> _parameters_1 = operation.getParameters();
int _length = ((Object[])Conversions.unwrapArray(_parameters_1, Object.class)).length;
int _minus = (_length - 1);
IntegerRange _upTo = new IntegerRange(0, _minus);
for (final Integer i : _upTo) {
EList<Parameter> _parameters_2 = operation.getParameters();
Parameter _get = _parameters_2.get((i).intValue());
EList<TParameter> _arguments = tMessage.getArguments();
TParameter _get_1 = _arguments.get((i).intValue());
ParameterValueMapping _createParameterValueMapping = this.createParameterValueMapping(_get, _get_1, lifeline);
result.add(_createParameterValueMapping);
}
}
_xblockexpression = result;
}
return _xblockexpression;
}
开发者ID:mjorod,项目名称:textram,代码行数:26,代码来源:MessageViewsGenerator.java
示例2: generateParameters
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public void generateParameters(final JvmExecutable it, final ITreeAppendable appendable, final GeneratorConfig config) {
boolean _isEmpty = it.getParameters().isEmpty();
boolean _not = (!_isEmpty);
if (_not) {
int _size = it.getParameters().size();
int _minus = (_size - 1);
IntegerRange _upTo = new IntegerRange(0, _minus);
for (final Integer i : _upTo) {
{
int _size_1 = it.getParameters().size();
final boolean last = (((i).intValue() + 1) == _size_1);
final JvmFormalParameter p = it.getParameters().get((i).intValue());
this.generateParameter(p, appendable, (last && it.isVarArgs()), config);
if ((!last)) {
appendable.append(", ");
}
}
}
}
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:JvmModelGenerator.java
示例3: getIndentation
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public String getIndentation(final int levels) {
String _xifexpression = null;
if ((levels > 0)) {
String _xblockexpression = null;
{
final String indent = this.cfg.get(BasicFormatterPreferenceKeys.indentation);
final Function1<Integer, String> _function = (Integer it) -> {
return indent;
};
_xblockexpression = IterableExtensions.join(IterableExtensions.<Integer, String>map(new IntegerRange(0, (levels - 1)), _function));
}
_xifexpression = _xblockexpression;
} else {
_xifexpression = "";
}
return _xifexpression;
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:18,代码来源:FormattableDocument.java
示例4: getWrap
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public String getWrap(final int levels) {
String _xifexpression = null;
if ((levels > 0)) {
String _xblockexpression = null;
{
final String sep = this.cfg.get(BasicFormatterPreferenceKeys.lineSeparator);
final Function1<Integer, String> _function = (Integer it) -> {
return sep;
};
_xblockexpression = IterableExtensions.join(IterableExtensions.<Integer, String>map(new IntegerRange(0, (levels - 1)), _function));
}
_xifexpression = _xblockexpression;
} else {
_xifexpression = "";
}
return _xifexpression;
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:18,代码来源:FormattableDocument.java
示例5: testValidity
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void testValidity() {
new IntegerRange(0, 0, 1);
new IntegerRange(0, 0, -1);
new IntegerRange(0, 2, 1);
new IntegerRange(-1, 2, 1);
new IntegerRange(-2, -1, 1);
new IntegerRange(2, 0, -1);
new IntegerRange(2, -1, -1);
new IntegerRange(-1, -2, -1);
new IntegerRange(-2, 0, 1);
new IntegerRange(Integer.MIN_VALUE, 0, 1);
new IntegerRange(Integer.MAX_VALUE, 0, -1);
assertInvalid(0, 1, 0);
assertInvalid(0, 2, -1);
assertInvalid(-1, 2, -1);
assertInvalid(-2, -1, -1);
assertInvalid(2, 0, 1);
assertInvalid(2, -1, 1);
assertInvalid(-1, -2, 1);
}
开发者ID:eclipse,项目名称:xtext-lib,代码行数:23,代码来源:IntegerRangeTest.java
示例6: testLongInputManyTasks
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的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());
}
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:26,代码来源:DefaultTaskParserTest.java
示例7: test_rates
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void test_rates() {
try {
final PropertyNode m = Metrics.create();
IntegerRange _upTo = new IntegerRange(1, 8);
for (final Integer i : _upTo) {
IntegerRange _upTo_1 = new IntegerRange(1, 10);
for (final Integer j : _upTo_1) {
{
m.<Long>record(Metrics.happened("de.mxro.test.meter1"));
Thread.sleep(100);
}
}
}
double _fiveMinuteRate = m.<Meter>retrieve("de.mxro.test.meter1", Meter.class).get().getFiveMinuteRate();
boolean _greaterThan = (_fiveMinuteRate > 8.0);
TestMeter.<Boolean, Boolean>operator_doubleArrow(Boolean.valueOf(_greaterThan), Boolean.valueOf(true));
double _fiveMinuteRate_1 = m.<Meter>retrieve("de.mxro.test.meter1", Meter.class).get().getFiveMinuteRate();
boolean _lessThan = (_fiveMinuteRate_1 < 12.0);
TestMeter.<Boolean, Boolean>operator_doubleArrow(Boolean.valueOf(_lessThan), Boolean.valueOf(true));
m.stop().get();
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
开发者ID:javadelight,项目名称:delight-metrics,代码行数:26,代码来源:TestMeter.java
示例8: isWhitespace
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
protected boolean isWhitespace(final String doc) {
int _length = doc.length();
int _minus = (_length - 1);
final Function1<Integer, Boolean> _function = (Integer it) -> {
return Boolean.valueOf(Character.isWhitespace(doc.charAt((it).intValue())));
};
return IterableExtensions.<Integer>forall(new IntegerRange(0, _minus), _function);
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:9,代码来源:FormattableDocument.java
示例9: testBlockExpression_03
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@IgnoredBySmokeTest("Do not run smoke test with 1000s of nested expressions")
@Test
public void testBlockExpression_03() throws Exception {
String input = "{ val s1 = \'\'\n";
final int max = 1000;
IntegerRange _upTo = new IntegerRange(1, max);
for (final Integer i : _upTo) {
input = (((((input + " val s") + Integer.valueOf(((i).intValue() + 1))) + " = s") + i) + "\n");
}
input = (((input + " s") + Integer.valueOf((max + 1))) + "}");
this.resolvesTo(input, "String");
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:13,代码来源:AbstractTypeResolverTest.java
示例10: assertInvalid
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
protected void assertInvalid(int start, int end, int step) {
try {
new IntegerRange(start, end, step);
fail("Invalid step not detected");
} catch (IllegalArgumentException e) {
// expected exception
}
}
开发者ID:eclipse,项目名称:xtext-lib,代码行数:9,代码来源:IntegerRangeTest.java
示例11: testContains_0
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void testContains_0() {
IntegerRange range = new IntegerRange(-1, 1, 2);
assertFalse(range.contains(-2));
assertTrue(range.contains(-1));
assertFalse(range.contains(0));
assertTrue(range.contains(1));
assertFalse(range.contains(2));
}
开发者ID:eclipse,项目名称:xtext-lib,代码行数:10,代码来源:IntegerRangeTest.java
示例12: testContains_1
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void testContains_1() {
IntegerRange range = new IntegerRange(-1, 2, 2);
assertFalse(range.contains(-2));
assertTrue(range.contains(-1));
assertFalse(range.contains(0));
assertTrue(range.contains(1));
assertFalse(range.contains(2));
}
开发者ID:eclipse,项目名称:xtext-lib,代码行数:10,代码来源:IntegerRangeTest.java
示例13: testSize
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void testSize() {
final IntegerRange myRange = new IntegerRange(-1, 1);
assertEquals(3, myRange.getSize());
assertEquals(2, myRange.withStep(2).getSize());
assertEquals(1, myRange.withStep(3).getSize());
final IntegerRange myRange2 = new IntegerRange(1, -1);
assertEquals(3, myRange2.getSize());
assertEquals(2, myRange2.withStep(-2).getSize());
assertEquals(1, myRange2.withStep(-3).getSize());
}
开发者ID:eclipse,项目名称:xtext-lib,代码行数:13,代码来源:IntegerRangeTest.java
示例14: testWeirdTemplateString
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void testWeirdTemplateString() {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("fooo bar");
_builder.newLine();
_builder.append("d ");
{
if ((2 > 1)) {
_builder.append("s");
_builder.newLineIfNotEmpty();
_builder.append("\t ");
_builder.append("ee ");
{
IntegerRange _upTo = new IntegerRange(1, 4);
for(final Integer i : _upTo) {
_builder.newLineIfNotEmpty();
_builder.newLineIfNotEmpty();
CharSequence _other = TemplateNodeTest.this.other();
_builder.append(_other);
_builder.append(" ");
_builder.append(i);
_builder.newLineIfNotEmpty();
String _multiLineString = TemplateNodeTest.this.multiLineString();
_builder.append(_multiLineString);
_builder.append(" ");
String _multiLineString_1 = TemplateNodeTest.this.multiLineString();
_builder.append(_multiLineString_1);
_builder.newLineIfNotEmpty();
}
}
}
}
}
};
this.assertEquals(_client);
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:39,代码来源:TemplateNodeTest.java
示例15: phone
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public static CharSequence phone() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("1");
_builder.append(Collections.<String>unmodifiableSet(CollectionLiterals.<String>newHashSet("1", "3", "5", "8")), "");
_builder.append(".get(RandomUtils.nextInt(0, 3))»");
IntegerRange _upTo = new IntegerRange(0, 8);
final Function1<Integer, String> _function = (Integer it) -> {
Integer _singleNumber = Randoms.singleNumber();
return _singleNumber.toString();
};
Iterable<String> _map = IterableExtensions.<Integer, String>map(_upTo, _function);
String _join = IterableExtensions.join(_map);
_builder.append(_join, "");
return _builder;
}
开发者ID:East196,项目名称:maker,代码行数:16,代码来源:Randoms.java
示例16: main
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public static void main(final String[] args) {
final Runnable _function = () -> {
InputOutput.<String>println("Hello I’m executed!");
};
final Runnable runnable = _function;
final Callable<String> _function_1 = () -> {
return InputOutput.<String>println("Hello I’m executed!");
};
final Callable<String> callable = _function_1;
final FutureTask<String> task = new FutureTask<String>(callable);
final Stopwatch stopwatch = new Stopwatch();
stopwatch.start();
Thread _thread = new Thread(runnable);
_thread.start();
IntegerRange _upTo = new IntegerRange(1, 1000000);
final Consumer<Integer> _function_2 = (Integer index) -> {
Thread _thread_1 = new Thread(task);
_thread_1.start();
};
_upTo.forEach(_function_2);
stopwatch.stop();
StringConcatenation _builder = new StringConcatenation();
_builder.append("ThreadSystem Hello-Tung Cost ");
long _elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS);
_builder.append(_elapsed, "");
_builder.append(" ms ( is ");
long _elapsed_1 = stopwatch.elapsed(TimeUnit.NANOSECONDS);
_builder.append(_elapsed_1, "");
_builder.append(" ns )");
InputOutput.<String>println(_builder.toString());
}
开发者ID:East196,项目名称:maker,代码行数:32,代码来源:ThreadMain.java
示例17: main
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public static void main(final String[] args) {
final Stopwatch stopwatch = new Stopwatch();
stopwatch.start();
final ActorSystem system = ActorSystem.create("Hello-Tung");
Props _create = Props.create(GreetingActor.class);
final ActorRef greeter = system.actorOf(_create, "greeter");
Greeting _greeting = new Greeting("Tung Out Room");
ActorRef _noSender = ActorRef.noSender();
greeter.tell(_greeting, _noSender);
IntegerRange _upTo = new IntegerRange(1, 10);
final Consumer<Integer> _function = (Integer index) -> {
Props _create_1 = Props.create(GreetingActor.class);
final ActorRef in = system.actorOf(_create_1, ("greeter" + index));
Greeting _greeting_1 = new Greeting(("Tung In Room" + index));
ActorRef _noSender_1 = ActorRef.noSender();
in.tell(_greeting_1, _noSender_1);
};
_upTo.forEach(_function);
stopwatch.stop();
StringConcatenation _builder = new StringConcatenation();
_builder.append("ActorSystem Hello-Tung Cost ");
long _elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS);
_builder.append(_elapsed, "");
_builder.append(" ms ( is ");
long _elapsed_1 = stopwatch.elapsed(TimeUnit.NANOSECONDS);
_builder.append(_elapsed_1, "");
_builder.append(" ns )");
InputOutput.<String>println(_builder.toString());
}
开发者ID:East196,项目名称:maker,代码行数:30,代码来源:AkkaMain.java
示例18: draw
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
public static void draw(final Renderer renderer, final ComplexBarShape shape) {
final List<Float> sizes = shape.getSizes();
final FloatPoint startCoordinate = shape.getStartCoordinate();
final FloatPoint endCoordinate = shape.getEndCoordinate();
Iterable<Float> _startCoordinates = DrawComplexBarShape.getStartCoordinates(sizes);
final Iterator<Float> startCoordinates = _startCoordinates.iterator();
Iterable<Float> _endCoordinates = DrawComplexBarShape.getEndCoordinates(sizes);
final Iterator<Float> endCoordinates = _endCoordinates.iterator();
Iterable<Color> _colors = shape.getColors();
final Iterator<Color> colors = _colors.iterator();
final float distance = (endCoordinate.x - startCoordinate.x);
int _size = sizes.size();
int _minus = (_size - 1);
IntegerRange _upTo = new IntegerRange(0, _minus);
for (final int i : _upTo) {
{
Color _next = colors.next();
final com.badlogic.gdx.graphics.Color color = ColorConvert.convert(_next);
Float _next_1 = startCoordinates.next();
float _multiply = (distance * (_next_1).floatValue());
final float spos = (startCoordinate.x + _multiply);
Float _next_2 = endCoordinates.next();
float _multiply_1 = (distance * (_next_2).floatValue());
final float epos = (startCoordinate.x + _multiply_1);
final FloatPoint start = new FloatPoint(spos, startCoordinate.y);
final FloatPoint end = new FloatPoint(epos, endCoordinate.y);
renderer.drawBox(start, end, color);
}
}
}
开发者ID:CymricNPG,项目名称:abattle,代码行数:31,代码来源:DrawComplexBarShape.java
示例19: test_rates
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
@Test
public void test_rates() {
try {
final PropertyNode m = Metrics.create();
IntegerRange _upTo = new IntegerRange(1, 8);
for (final Integer i : _upTo) {
IntegerRange _upTo_1 = new IntegerRange(1, 10);
for (final Integer j : _upTo_1) {
{
PropertyOperation<Long> _happened = Metrics.happened("de.mxro.test.meter1");
m.<Long>record(_happened);
Thread.sleep(100);
}
}
}
Promise<Meter> _retrieve = m.<Meter>retrieve("de.mxro.test.meter1", Meter.class);
Meter _get = _retrieve.get();
double _fiveMinuteRate = _get.getFiveMinuteRate();
boolean _greaterThan = (_fiveMinuteRate > 8.0);
TestMeter.<Boolean, Boolean>operator_doubleArrow(Boolean.valueOf(_greaterThan), Boolean.valueOf(true));
Promise<Meter> _retrieve_1 = m.<Meter>retrieve("de.mxro.test.meter1", Meter.class);
Meter _get_1 = _retrieve_1.get();
double _fiveMinuteRate_1 = _get_1.getFiveMinuteRate();
boolean _lessThan = (_fiveMinuteRate_1 < 12.0);
TestMeter.<Boolean, Boolean>operator_doubleArrow(Boolean.valueOf(_lessThan), Boolean.valueOf(true));
Promise<Success> _stop = m.stop();
_stop.get();
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
开发者ID:mxro,项目名称:lightweight-java-metrics,代码行数:32,代码来源:TestMeter.java
示例20: haveSameArgumentsTypeOnMessageInteraction
import org.eclipse.xtext.xbase.lib.IntegerRange; //导入依赖的package包/类
private boolean haveSameArgumentsTypeOnMessageInteraction(final EList<TParameter> list, final EList<TValueSpecification> list2) {
try {
int _size = list.size();
int _size_1 = list2.size();
boolean _notEquals = (_size != _size_1);
if (_notEquals) {
throw new Exception("Argument\'s lists are not the same size");
}
boolean _and = false;
boolean _isEmpty = list.isEmpty();
boolean _equals = (_isEmpty == false);
if (!_equals) {
_and = false;
} else {
boolean _isEmpty_1 = list2.isEmpty();
boolean _equals_1 = (_isEmpty_1 == false);
_and = _equals_1;
}
if (_and) {
int _size_2 = list.size();
int _minus = (_size_2 - 1);
IntegerRange _upTo = new IntegerRange(0, _minus);
for (final Integer i : _upTo) {
TParameter _get = list.get((i).intValue());
Type _type = _get.getType();
String _name = _type.getName();
TValueSpecification _get_1 = list2.get((i).intValue());
String _typeNameForTValueSpecification = this.getTypeNameForTValueSpecification(_get_1);
boolean _notEquals_1 = (!Objects.equal(_name, _typeNameForTValueSpecification));
if (_notEquals_1) {
return false;
}
}
}
return true;
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
开发者ID:mjorod,项目名称:textram,代码行数:40,代码来源:TextRAMValidator.java
注:本文中的org.eclipse.xtext.xbase.lib.IntegerRange类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论