• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IntHolder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.omg.CORBA.IntHolder的典型用法代码示例。如果您正苦于以下问题:Java IntHolder类的具体用法?Java IntHolder怎么用?Java IntHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IntHolder类属于org.omg.CORBA包,在下文中一共展示了IntHolder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readVInt

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
private int readVInt(IntHolder pos) {
	byte b = this.concatenated[pos.value];
	pos.value++;
	if (b >= 0) {
		return b;
	} else {
		int res = (b & 0x7F);
		int shift = 7;
		while (true) {
			b = this.concatenated[pos.value];
			pos.value++;
			if (b > 0) {
				res = res | (b << shift);
				break;
			} else {
				res = res | ((b & 0x7F) << shift);
				shift += 7;
			}
		}
		return res;
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:23,代码来源:VIntIndexedTransactionsList.java


示例2: getTask

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
public synchronized CandidateCounters getTask(IntHolder boundHolder) throws StopPreparingJobsException,
		StopResumingJobsException {
	while (!stackedEs.isEmpty() && stackedEs.peek().getCandidate() == this.nextConsumable) {
		this.nextConsumable++;
		CandidateCounters next = stackedEs.poll();
		if (next.getNewCandidateBound() > 0) {
			this.minBoundToNextConsumable = Math
					.min(this.minBoundToNextConsumable, next.getNewCandidateBound());
		}
		if (next.counters != null) {
			boundHolder.value = this.minBoundToNextConsumable;
			return next;
		}
	}
	if (this.nextConsumable >= ExplorationStep.INSERT_UNCLOSED_UP_TO_ITEM) {
		if (this.stackedEs.isEmpty()) {
			throw new StopResumingJobsException();
		} else {
			throw new StopPreparingJobsException();
		}
	}
	boundHolder.value = this.minBoundToNextConsumable;
	return null;
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:25,代码来源:TopPI.java


示例3: readPart

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Read the name part (id or kind).
 *
 * @param p the current position. After reading, advances
 * to the beginning of the next name fragment.
 *
 * @param t the string buffer.
 *
 * @return the name part with resolved escape sequences.
 */
private String readPart(IntHolder p, String[] t)
{
  CPStringBuilder part = new CPStringBuilder();

  while (t [ p.value ] != null && !t [ p.value ].equals(".") &&
         !t [ p.value ].equals("/")
        )
    {
      if (t [ p.value ].equals(ESCAPE))
        {
          p.value++;
          part.append(t [ p.value ]);
        }
      else
        part.append(t [ p.value ]);

      p.value++;
    }

  return part.toString();
}
 
开发者ID:vilie,项目名称:javify,代码行数:32,代码来源:NameTransformer.java


示例4: shouldSupportATrailingOption

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldSupportATrailingOption() throws InterruptedException, ExecutionException {
	DebounceOptions<Void> o0 = new DebounceOptions<Void>().executor(executor).trailing(true);
	DebounceOptions<Void> o1 = new DebounceOptions<Void>().executor(executor).trailing(false);

	IntHolder withCount = new IntHolder(0);
	IntHolder withoutCount = new IntHolder(0);

	Runnable withTrailing = Lodash.debounce(() -> {
		withCount.value++;
	} , 32, o0);
	Runnable withoutTrailing = Lodash.debounce(() -> {
		withoutCount.value++;
	} , 32, o1);

	withTrailing.run();
	Assert.assertEquals(0, withCount.value);

	withoutTrailing.run();
	Assert.assertEquals(0, withoutCount.value);

	o1.setTimeout().apply(() -> {
		Assert.assertEquals(1, withCount.value);
		Assert.assertEquals(0, withoutCount.value);
	} , 64L).get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:27,代码来源:LodashDebounceTests.java


示例5: shouldSupportAMaxWaitOption

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldSupportAMaxWaitOption() throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);
	DebounceOptions<Void> o = new DebounceOptions<Void>().executor(executor).maxWait(64);
	Runnable debounced = Lodash.debounce(() -> {
		callCount.value++;
	} , 32, o);
	debounced.run();
	debounced.run();
	Assert.assertEquals(0, callCount.value);

	Future<?> f1 = o.setTimeout().apply(() -> {
		Assert.assertEquals(1, callCount.value);
		debounced.run();
		debounced.run();
		Assert.assertEquals(1, callCount.value);
	} , 128L);
	Future<?> f2 = o.setTimeout().apply(() -> {
		Assert.assertEquals(2, callCount.value);
	} , 256L);

	f1.get();
	f2.get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:25,代码来源:LodashDebounceTests.java


示例6: shouldQueueATrailingCallForSubsequentDebouncedCallsAfterMaxWait

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldQueueATrailingCallForSubsequentDebouncedCallsAfterMaxWait()
		throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);
	DebounceOptions<Void> o = new DebounceOptions<Void>().executor(executor).maxWait(200);
	Runnable debounced = Lodash.debounce(() -> {
		callCount.value++;
	} , 200, o);

	debounced.run();

	o.setTimeout().apply(debounced, 190L);
	o.setTimeout().apply(debounced, 200L);
	o.setTimeout().apply(debounced, 210L);

	o.setTimeout().apply(() -> {
		Assert.assertEquals(2, callCount.value);
	} , 500L).get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:20,代码来源:LodashDebounceTests.java


示例7: shouldInvokeTheTrailingCallWithTheCorrectArguments

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldInvokeTheTrailingCallWithTheCorrectArguments() throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);
	DebounceOptions<Boolean> o = new DebounceOptions<Boolean>().executor(executor).leading(true).maxWait(64);

	List<Integer> actualA = new ArrayList<>();
	List<String> actualB = new ArrayList<>();

	BiFunction<Integer, String, Boolean> debounced = Lodash.debounce((a, b) -> {
		actualA.add(a);
		actualB.add(b);
		return ++callCount.value != 2;
	} , 32, o);

	while (true) {
		if (!debounced.apply(1, "a")) {
			break;
		}
	}

	o.setTimeout().apply(() -> {
		Assert.assertEquals(2, callCount.value);
		Assert.assertEquals(Arrays.asList(1, 1), actualA);
		Assert.assertEquals(Arrays.asList("a", "a"), actualB);
	} , 64L).get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:27,代码来源:LodashDebounceTests.java


示例8: initStack

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
void initStack( Node start )
{
	Node child = start;
	Node parent = child.getParent( );
	
	final Stack<IntHolder> revStack = new Stack<IntHolder>( );
	
	while( parent != null )
	{
		if( parent instanceof Group )
		{
			revStack.push( new IntHolder( ( ( Group ) parent ).indexOfChild( child ) ) );
		}
		child = parent;
		parent = child.getParent( );
	}
	
	while( !revStack.isEmpty( ) )
	{
		indexStack.push( revStack.pop( ) );
	}
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:23,代码来源:SceneGraphIterator.java


示例9: nextPreprocessed

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
public Counters nextPreprocessed(PerItemTopKCollector collector, IntHolder candidateHolder, IntHolder boundHolder) {
	if (this.candidates == null) {
		candidateHolder.value = -1;
		return null;
	}
	int candidate = this.candidates.next();

	if (candidate < 0) {
		candidateHolder.value = -1;
		return null;
	} else {
		candidateHolder.value = candidate;
		return this.prepareExploration(candidate, collector, boundHolder);
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:16,代码来源:ExplorationStep.java


示例10: resumeExploration

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
public ExplorationStep resumeExploration(Counters candidateCounts, int candidate, PerItemTopKCollector collector,
		int countersMinSupportVerification) {
	if (ultraVerbose) {
		System.err.format("{\"time\":\"%1$tY/%1$tm/%1$td %1$tk:%1$tM:%1$tS\",\"thread\":%2$d,\"resume_candidate\":%3$d}\n",
						Calendar.getInstance(), Thread.currentThread().getId(), candidate);
	}
	
	// check that the counters we made are also ok for all items < candidate
	if (candidateCounts.getMinSupport() > countersMinSupportVerification &&
			candidateCounts.getMinSupport() > this.counters.getMinSupport()) {
		CountersHandler.increment(TopPICounters.RedoCounters);
		candidateCounts = prepareExploration(candidate, collector, new IntHolder(countersMinSupportVerification),
				true);
	}
	if (candidate < INSERT_UNCLOSED_UP_TO_ITEM) {
		candidateCounts.raiseMinimumSupport(collector);
		if (LOG_EPSILONS) {
			synchronized (System.out) {
				if (this.counters != null && this.counters.getPattern() != null
						&& this.counters.getPattern().length == 0) {
					System.out.println(candidate + " " + candidateCounts.getMinSupport());
				}
			}
		}
	}
	Dataset dataset = this.datasetProvider.getDatasetForSupportThreshold(candidateCounts.getMinSupport());
	ExplorationStep next = new ExplorationStep(this, dataset, candidate, candidateCounts,
			dataset.getSupport(candidate));
	return next;
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:31,代码来源:ExplorationStep.java


示例11: get_long

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public int get_long() throws TypeMismatch
{
  try
    {
      return ((IntHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:gnuDynAny.java


示例12: insert_long

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public void insert_long(int a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((IntHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:gnuDynAny.java


示例13: insert_ulong

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public void insert_ulong(int a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((IntHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:gnuDynAny.java


示例14: toName

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Convert the string name representation into the array name
 * representation. See {@link #toString(NameComponent)} for the
 * description of this format.
 *
 * @param a_name the string form of the name.
 *
 * @return the array form of the name.
 *
 * @throws InvalidName if the name cannot be parsed.
 */
public NameComponent[] toName(String a_name)
                       throws InvalidName
{
  ArrayList components = new ArrayList();
  StringTokenizer st = new StringTokenizer(a_name, "./\\", true);

  // Create the buffer array, reserving the last element for null.
  String[] n = new String[ st.countTokens() + 1 ];

  int pp = 0;
  while (st.hasMoreTokens())
    n [ pp++ ] = st.nextToken();

  IntHolder p = new IntHolder();

  NameComponent node = readNode(p, n);

  while (node != null)
    {
      components.add(node);
      node = readNode(p, n);
    }

  NameComponent[] name = new NameComponent[ components.size() ];
  for (int i = 0; i < name.length; i++)
    {
      name [ i ] = (NameComponent) components.get(i);
    }

  NameValidator.check(name);

  return name;
}
 
开发者ID:vilie,项目名称:javify,代码行数:45,代码来源:NameTransformer.java


示例15: assertEndOfNode

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Assert the end of the current name component.
 */
private void assertEndOfNode(IntHolder p, String[] t)
                      throws InvalidName
{
  if (t [ p.value ] != null)
    if (!t [ p.value ].equals("/"))
      throw new InvalidName("End of node expected at token " + p.value);
}
 
开发者ID:vilie,项目名称:javify,代码行数:11,代码来源:NameTransformer.java


示例16: extract_long

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public int extract_long()
                 throws BAD_OPERATION
{
  // CORBA long = java int.
  check(TCKind._tk_long);
  return ((IntHolder) has).value;
}
 
开发者ID:vilie,项目名称:javify,代码行数:9,代码来源:gnuAny.java


示例17: extract_ulong

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public int extract_ulong()
                  throws BAD_OPERATION
{
  // IntHolder also holds ulongs.
  check(TCKind._tk_ulong);
  return ((IntHolder) has).value;
}
 
开发者ID:vilie,项目名称:javify,代码行数:9,代码来源:gnuAny.java


示例18: testWait

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void testWait() {
	Thread thread = new Thread(new Runnable() {
		public void run() {
			Process.wait(NOTEPAD_PROC_NAME);
		}
	});
	thread.start();
	sleep(2000);
	Assert.assertTrue(thread.isAlive());

	// run notepad
	int pid = runNotepad();
	Assert.assertFalse(thread.isAlive());

	// close notepad
	Process.close(pid);
	sleep(500);
	Assert.assertFalse(Process.exists(pid));

	final IntHolder timeHolder = new IntHolder();
	thread = new Thread(new Runnable() {
		public void run() {
			long start = System.currentTimeMillis();
			Process.wait(NOTEPAD_PROC_NAME, 2);
			long end = System.currentTimeMillis();
			timeHolder.value = (int) (end - start);
		}
	});
	thread.start();
	sleep(3000);
	Assert.assertFalse(thread.isAlive());
	Assert.assertTrue("Assert timeHolder.value >= 2000, but actual is "
			+ timeHolder.value + ".", timeHolder.value >= 2000);
	Assert.assertTrue("Assert timeHolder.value <= 3000, but actual is "
			+ timeHolder.value + ".", timeHolder.value <= 3000);
}
 
开发者ID:wangzhengbo,项目名称:JAutoItX,代码行数:38,代码来源:ProcessTest.java


示例19: replaceNewExpression

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Replaces a `new oldClass()` expression in the target class or methods with `new newClass();
 * oldClass and one of newClass or code must be specified.
 *
 * @param oldClass Type of new expression to replace
 * @param newClass (optional) New type to construct
 * @param code     (optional) $_ = new newClass();
 */
@Patch(
	requiredAttributes = "oldClass",
	emptyConstructor = false
)
public void replaceNewExpression(Object o, Map<String, String> attributes) throws CannotCompileException, NotFoundException {
	final String type = attributes.get("oldClass");
	final String code = attributes.get("code");
	final String clazz = attributes.get("newClass");
	if (code == null && clazz == null) {
		throw new NullPointerException("Must give code or class");
	}
	final String newInitializer = code == null ? "$_ = new " + clazz + "();" : code;
	final Set<CtBehavior> allBehaviours = new HashSet<>();
	if (o instanceof CtClass) {
		CtClass ctClass = (CtClass) o;
		allBehaviours.addAll(Arrays.asList(ctClass.getDeclaredBehaviors()));
	} else {
		allBehaviours.add((CtBehavior) o);
	}
	final IntHolder done = new IntHolder();
	for (CtBehavior ctBehavior : allBehaviours) {
		ctBehavior.instrument(new ExprEditor() {
			@Override
			public void edit(NewExpr e) throws CannotCompileException {
				if (e.getClassName().equals(type)) {
					e.replace(newInitializer);
					done.value++;
				}
			}
		});
	}
	if (done.value == 0) {
		PatcherLog.error("No new expressions found for replacement.");
	}
}
 
开发者ID:nallar,项目名称:JavaPatcher,代码行数:44,代码来源:Patches.java


示例20: shouldDebounceAFunction

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldDebounceAFunction() throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);

	Function<Character, Character> debounced = Lodash.debounce(v -> {
		callCount.value++;
		return v;
	} , 32, new DebounceOptions<Character>().executor(executor));

	Character[] results = new Character[] { debounced.apply('a'), debounced.apply('b'), debounced.apply('c') };
	Assert.assertArrayEquals(new Character[] { null, null, null }, results);
	Assert.assertEquals(0, callCount.value);

	Future<?> f1 = executor.schedule(() -> {
		Assert.assertEquals(1, callCount.value);

		Character[] results2 = new Character[] { debounced.apply('a'), debounced.apply('b'), debounced.apply('c') };
		Assert.assertArrayEquals(new Character[] { 'c', 'c', 'c' }, results2);
		Assert.assertEquals(1, callCount.value);
	} , 128, TimeUnit.MILLISECONDS);

	Future<?> f2 = executor.schedule(() -> {
		Assert.assertEquals(2, callCount.value);
	} , 256, TimeUnit.MILLISECONDS);

	f1.get();
	f2.get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:29,代码来源:LodashDebounceTests.java



注:本文中的org.omg.CORBA.IntHolder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UnmodifiableMap类代码示例发布时间:2022-05-22
下一篇:
Java TFile类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap