本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
}