当前位置: 首页>>代码示例>>Java>>正文


Java LongHolder类代码示例

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


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

示例1: get_longlong

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

示例2: insert_longlong

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

示例3: insert_ulonglong

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

示例4: extract_longlong

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

示例5: extract_ulonglong

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

示例6: setWinWaitDelay

import org.omg.CORBA.LongHolder; //导入依赖的package包/类
@Test
public void setWinWaitDelay() {
	try {
		// delay 5 seconds
		Assert.assertEquals(Opt.DEFAULT_WIN_WAIT_DELAY,
				Opt.setWinWaitDelay(3000));
		final LongHolder time = new LongHolder(0);
		Thread thread = new Thread(new Runnable() {
			public void run() {
				long start = System.currentTimeMillis();
				Win.wait(NOTEPAD_TITLE);
				long end = System.currentTimeMillis();
				time.value = end - start;
			}
		});
		thread.start();
		runNotepad();
		sleep(4000);
		Assert.assertTrue(String.format("%d >= 3000", time.value),
				time.value >= 3000);
		Assert.assertTrue(String.format("%d <= 4000", time.value),
				time.value <= 4000);
		Assert.assertFalse(thread.isAlive());
		Win.close(NOTEPAD_TITLE);

		// delay 2 seconds
		Assert.assertEquals(3000, Opt.setWinWaitDelay(2000));
		time.value = 0;
		thread = new Thread(new Runnable() {
			public void run() {
				long start = System.currentTimeMillis();
				Win.wait(NOTEPAD_TITLE);
				long end = System.currentTimeMillis();
				time.value = end - start;
			}
		});
		thread.start();
		runNotepad();
		while (thread.isAlive()) {
			sleep(100);
		}
		Assert.assertTrue(String.format("%d >= 2000", time.value),
				time.value >= 2000);
		Assert.assertTrue(String.format("%d <= 3000", time.value),
				time.value <= 3000);
		Assert.assertFalse(thread.isAlive());
		Win.close(NOTEPAD_TITLE);
	} finally {
		// restore default win delay
		Opt.setWinWaitDelay(Opt.DEFAULT_WIN_WAIT_DELAY);
	}
}
 
开发者ID:wangzhengbo,项目名称:JAutoItX,代码行数:53,代码来源:OptTest.java


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