本文整理汇总了Java中com.gs.collections.impl.set.mutable.primitive.IntHashSet.newSetWith方法的典型用法代码示例。如果您正苦于以下问题:Java IntHashSet.newSetWith方法的具体用法?Java IntHashSet.newSetWith怎么用?Java IntHashSet.newSetWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.gs.collections.impl.set.mutable.primitive.IntHashSet
的用法示例。
在下文中一共展示了IntHashSet.newSetWith方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testParameterizedRelationships
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testParameterizedRelationships()
{
Operation stringParamOperation = ParentTypeFinder.nameEquals("value").exists();
assertEquals("ParentType.nameEquals(ParentType filters: none, ParentType filters: ParentType.name = \"value\") exists", stringParamOperation.toString());
Operation doubleParamOperation = OrderFinder.cheapItems(1.00).exists();
assertEquals("Order.cheapItems(OrderItem.originalPrice < 1.0) exists", doubleParamOperation.toString());
Operation intParamOperation = OrderFinder.itemForProduct(2).exists();
assertEquals("Order.itemForProduct(OrderItem.productId = 2) exists", intParamOperation.toString());
IntHashSet intSet = IntHashSet.newSetWith(3, 4);
Operation inParamOperation = OrderFinder.itemForProductSet(intSet).exists();
assertTrue("Order.itemForProductSet(OrderItem.productId in [3, 4]) exists".equals(inParamOperation.toString())
|| "Order.itemForProductSet(OrderItem.productId in [4, 3]) exists".equals(inParamOperation.toString()));
Operation timestampParamOperation = TradeFinder.tradesByTradeRef(Timestamp.valueOf("2010-12-31 23:59:00.0"), Timestamp.valueOf("2011-01-01 23:59:00.0")).exists();
assertEquals("Trade.tradesByTradeRef(Trade filters: none, Trade filters: Trade.processingDate = \"2011-01-01 23:59:00.0\" & Trade.businessDate = \"2010-12-31 23:59:00.0\") exists", timestampParamOperation.toString());
}
示例2: testThreeLevelDeepStartingFromNonDated
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testThreeLevelDeepStartingFromNonDated() throws Exception
{
Timestamp tradeDate = new Timestamp(timestampFormat.parse("2013-11-26 00:00:00").getTime());
IntHashSet accountIdSet = IntHashSet.newSetWith(39955000);
final Set<String> exchangeCodeSet = UnifiedSet.newSetWith("AMEX", "BOSE");
Operation op = MagEventFinder.magellanSourceInstanceId().eq(0);
op = op.and(MagEventFinder.eventBusinessDate().lessThanEquals(tradeDate));
op = op.and(MagEventFinder.eventBusinessDate().greaterThanEquals(tradeDate));
op = op.and(MagEventFinder.transaction().accountId().in(accountIdSet));
op = op.and(MagEventFinder.transaction().reportingAttributes().exchangeCode().in(exchangeCodeSet));
MagEventList magEvents = MagEventFinder.findMany(op);
magEvents.deepFetch(MagEventFinder.transaction().trade().productId());
assertEquals(2, magEvents.size());
int retrievalCount = this.getRetrievalCount();
for(int i=0;i<2;i++)
{
assertNotNull(magEvents.get(i).getTransaction().getTrade());
assertNotNull(magEvents.get(i).getTransaction().getTrade().getProductId());
}
assertEquals(retrievalCount, this.getRetrievalCount());
}
示例3: testThreeLevelDeepStartingFromNonDatedTripleInClause
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testThreeLevelDeepStartingFromNonDatedTripleInClause() throws Exception
{
Timestamp tradeDate = new Timestamp(timestampFormat.parse("2013-11-26 00:00:00").getTime());
IntHashSet accountIdSet = IntHashSet.newSetWith(39955000);
final Set<String> exchangeCodeSet = UnifiedSet.newSetWith("AMEX", "BOSE");
IntHashSet primeIdSet = IntHashSet.newSetWith(0, 1, 2, 370227706, 1003032317);
Operation op = MagEventFinder.magellanSourceInstanceId().eq(0);
op = op.and(MagEventFinder.eventBusinessDate().lessThanEquals(tradeDate));
op = op.and(MagEventFinder.eventBusinessDate().greaterThanEquals(tradeDate));
op = op.and(MagEventFinder.transaction().accountId().in(accountIdSet));
op = op.and(MagEventFinder.transaction().reportingAttributes().exchangeCode().in(exchangeCodeSet));
op = op.and(MagEventFinder.transaction().trade().productId().primeId().in(primeIdSet));
MagEventList magEvents = MagEventFinder.findMany(op);
magEvents.deepFetch(MagEventFinder.transaction().trade().productId());
assertEquals(2, magEvents.size());
int retrievalCount = this.getRetrievalCount();
for(int i=0;i<2;i++)
{
assertNotNull(magEvents.get(i).getTransaction().getTrade());
assertNotNull(magEvents.get(i).getTransaction().getTrade().getProductId());
}
assertEquals(retrievalCount, this.getRetrievalCount());
}
示例4: testOrWithHiddenAll
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testOrWithHiddenAll()
{
IntHashSet set = IntHashSet.newSetWith(1, 2, 3);
IntHashSet empty = new IntHashSet();
Operation op = OrderFinder.userId().in(set).and(OrderFinder.orderId().notIn(empty));
assertEquals(OrderFinder.findMany(OrderFinder.all()).size(), OrderFinder.findMany(op).size());
}
示例5: testNoneCacheDeepFetchInParallel
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testNoneCacheDeepFetchInParallel()
{
IntHashSet ids = IntHashSet.newSetWith(new int[]{1, 2, 4});
TestConflictCheckImplList checkList;
checkList = new TestConflictCheckImplList(TestConflictCheckImplFinder.id().in(ids));
int count = dbCalls();
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().sellSideDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().nonAcquisitionDealDetail());
checkList.setNumberOfParallelThreads(3);
assertEquals(3, checkList.size());
assertEquals(4, dbCalls() - count);
checkList = new TestConflictCheckImplList(TestConflictCheckImplFinder.id().in(ids));
count = dbCalls();
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().sellSideDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().nonAcquisitionDealDetail());
checkList.setNumberOfParallelThreads(3);
assertEquals(3, checkList.size());
assertEquals(4, dbCalls() - count);
}
示例6: testManyToManyDeepFetch
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testManyToManyDeepFetch()
{
IntHashSet ids = IntHashSet.newSetWith(new int[]{4, 5, 6, 7});
TestConflictCheckImplList checkList;
checkList = new TestConflictCheckImplList(TestConflictCheckImplFinder.id().in(ids));
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().sellSideDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().nonAcquisitionDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.securitiesDealDetail().checkDesks());
if (GsDeskFinder.getMithraObjectPortal().getCache().isPartialCache())
{
checkList.deepFetch(TestConflictCheckImplFinder.securitiesDealDetail().checkDesks().gsDesk());
}
checkList.size();
int dbCalls = dbCalls();
checkList.get(0).getSecuritiesDealDetail();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getSecuritiesDealDetail().getCheckDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getSecuritiesDealDetail().getCheckDesks().getGsDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getDetachedCopy().getSecuritiesDealDetail();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getSecuritiesDealDetail().getDetachedCopy().getCheckDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getDetachedCopy().getSecuritiesDealDetail().getCheckDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getDetachedCopy().getSecuritiesDealDetail().getCheckDesks().getGsDesks();
assertEquals(dbCalls, dbCalls());
}
示例7: testAttributeAsSet
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testAttributeAsSet()
{
UserList users = new UserList(UserFinder.sourceId().eq(0));
assertEquals(IntHashSet.newSetWith(new int[] { 1, 2 }), UserFinder.profileId().asGscSet(users));
assertEquals(IntHashSet.newSetWith(1, 2), UserFinder.profileId().asGscSet(users));
IntHashSet gscIntHashSet = IntHashSet.newSetWith(new int[] { -42 });
UserFinder.profileId().asSet(users, gscIntHashSet);
assertEquals(IntHashSet.newSetWith(new int[]{1, 2, -42}), gscIntHashSet);
MutableIntSet intSet = IntHashSet.newSetWith(-42);
assertEquals(IntHashSet.newSetWith(1, 2, -42), UserFinder.profileId().asSet(users, intSet));
}
示例8: testExistsNonDatedToDated
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testExistsNonDatedToDated() throws Exception
{
Timestamp asOfDate = new Timestamp(timestampFormat.parse("2000-01-02 00:00:00.0").getTime());
IntHashSet set = IntHashSet.newSetWith(new int[]{1,2,3});
NotDatedTableList notDated = new NotDatedTableList(NotDatedTableFinder.id().in(set).and(NotDatedTableFinder.datedTable(asOfDate).exists()));
notDated.setOrderBy(NotDatedTableFinder.id().ascendingOrderBy());
assertEquals(2, notDated.size());
assertEquals(1, notDated.get(0).getId());
assertEquals(3, notDated.get(1).getId());
}
示例9: createSetOneTwo
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
private IntHashSet createSetOneTwo()
{
return IntHashSet.newSetWith(1, 2);
}
示例10: testManyToManyDeepFetchInParallel
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testManyToManyDeepFetchInParallel()
{
IntHashSet ids = IntHashSet.newSetWith(new int[]{4, 5, 6, 7});
TestConflictCheckImplList checkList;
checkList = new TestConflictCheckImplList(TestConflictCheckImplFinder.id().in(ids));
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().sellSideDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().nonAcquisitionDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.securitiesDealDetail().checkDesks());
if (GsDeskFinder.getMithraObjectPortal().getCache().isPartialCache())
{
checkList.deepFetch(TestConflictCheckImplFinder.securitiesDealDetail().checkDesks().gsDesk());
}
checkList.setNumberOfParallelThreads(4);
checkList.size();
int dbCalls = dbCalls();
checkList.get(0).getSecuritiesDealDetail();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getSecuritiesDealDetail().getCheckDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getSecuritiesDealDetail().getCheckDesks().getGsDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getDetachedCopy().getSecuritiesDealDetail();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getSecuritiesDealDetail().getDetachedCopy().getCheckDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getDetachedCopy().getSecuritiesDealDetail().getCheckDesks();
assertEquals(dbCalls, dbCalls());
checkList.get(0).getDetachedCopy().getSecuritiesDealDetail().getCheckDesks().getGsDesks();
assertEquals(dbCalls, dbCalls());
}
示例11: testNoneCacheDeepFetch
import com.gs.collections.impl.set.mutable.primitive.IntHashSet; //导入方法依赖的package包/类
public void testNoneCacheDeepFetch()
{
IntHashSet ids = IntHashSet.newSetWith(new int[]{1, 2, 4});
TestConflictCheckImplList checkList;
checkList = new TestConflictCheckImplList(TestConflictCheckImplFinder.id().in(ids));
int count = dbCalls();
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().sellSideDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().nonAcquisitionDealDetail());
assertEquals(3, checkList.size());
assertEquals(4, dbCalls() - count);
checkList = new TestConflictCheckImplList(TestConflictCheckImplFinder.id().in(ids));
count = dbCalls();
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().sellSideDealDetail());
checkList.deepFetch(TestConflictCheckImplFinder.bankingDealDetail().nonAcquisitionDealDetail());
assertEquals(3, checkList.size());
assertEquals(4, dbCalls() - count);
}