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


Java FastList类代码示例

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


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

示例1: csvToList

import javolution.util.FastList; //导入依赖的package包/类
public static List<List<String>> csvToList(String csv, Delegator delegator) {
    List<List<String>> outList = FastList.newInstance();
    List<String> contentIdList = StringUtil.split(csv, ",");
    GenericValue content = null;
    String contentName = null;
    List<String> values = null;
    for (String contentId : contentIdList) {
        try {
            content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne();
        } catch (GenericEntityException e) {
            Debug.logError(e.getMessage(), module);
            return FastList.newInstance();
        }
        contentName = (String)content.get("contentName");
        values = FastList.newInstance();
        values.add(contentId);
        values.add(contentName);
        outList.add(values);
    }
    return outList;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:22,代码来源:ContentWorker.java

示例2: makeProductFeatureCategoryIdListFromPrefixed

import javolution.util.FastList; //导入依赖的package包/类
/**
 *  Handles parameters coming in prefixed with "SEARCH_PROD_FEAT_CAT"
 *  where the parameter value is a productFeatureCategoryId;
 *  meant to be used with text entry boxes or check-boxes and such
 **/
public static List<String> makeProductFeatureCategoryIdListFromPrefixed(Map<String, Object> parameters) {
    List<String> prodFeatureCategoryIdList = FastList.newInstance();
    if (parameters == null) return prodFeatureCategoryIdList;

    for (Map.Entry<String, Object> entry: parameters.entrySet()) {
        String parameterName = entry.getKey();
        if (parameterName.startsWith("SEARCH_PROD_FEAT_CAT")) {
            String productFeatureCategoryId = (String) entry.getValue();
            if (UtilValidate.isNotEmpty(productFeatureCategoryId)) {
               prodFeatureCategoryIdList.add(productFeatureCategoryId);
            }
        }
    }
    return prodFeatureCategoryIdList;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:21,代码来源:ParametricSearch.java

示例3: getShippableItemInfo

import javolution.util.FastList; //导入依赖的package包/类
/** Returns a List of shippable item info (quantity, size, weight) for a specific ship group */
public List<Map<String, Object>> getShippableItemInfo(int idx) {
    CartShipInfo info = this.getShipInfo(idx);
    List<Map<String, Object>> itemInfos = FastList.newInstance();

    for (ShoppingCartItem item : info.shipItemInfo.keySet()) {
        CartShipInfo.CartShipItemInfo csii = info.shipItemInfo.get(item);
        if (csii != null && csii.quantity.compareTo(BigDecimal.ZERO) > 0) {
            if (item.shippingApplies()) {
                Map<String, Object> itemInfo = item.getItemProductInfo();
                itemInfo.put("quantity", csii.quantity);
                itemInfos.add(itemInfo);
            }
        }
    }

    return itemInfos;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:19,代码来源:ShoppingCart.java

示例4: searchGetConstraintStrings

import javolution.util.FastList; //导入依赖的package包/类
public List<String> searchGetConstraintStrings(boolean detailed, Delegator delegator, Locale locale) {
    List<ProductSearchConstraint> productSearchConstraintList = this.getConstraintList();
    List<String> constraintStrings = FastList.newInstance();
    if (productSearchConstraintList == null) {
        return constraintStrings;
    }
    for (ProductSearchConstraint productSearchConstraint: productSearchConstraintList) {
        if (productSearchConstraint == null) continue;
        String constraintString = productSearchConstraint.prettyPrintConstraint(delegator, detailed, locale);
        if (UtilValidate.isNotEmpty(constraintString)) {
            constraintStrings.add(constraintString);
        } else {
            constraintStrings.add("Description not available");
        }
    }
    return constraintStrings;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:18,代码来源:ProductSearchSession.java

示例5: getProductFeaturesByApplTypeId

import javolution.util.FastList; //导入依赖的package包/类
public static List<GenericValue> getProductFeaturesByApplTypeId(GenericValue product, String productFeatureApplTypeId) {
    if (product == null) {
        return null;
    }
    List<GenericValue> features = null;
    try {
        List<GenericValue> productAppls;
        List<EntityCondition> condList = UtilMisc.toList(
                EntityCondition.makeCondition("productId", product.getString("productId")),
                EntityUtil.getFilterByDateExpr()
        );
        if (productFeatureApplTypeId != null) {
            condList.add(EntityCondition.makeCondition("productFeatureApplTypeId", productFeatureApplTypeId));
        }
        EntityCondition cond = EntityCondition.makeCondition(condList);
        productAppls = product.getDelegator().findList("ProductFeatureAppl", cond, null, null, null, false);
        features = EntityUtil.getRelated("ProductFeature", null, productAppls, false);
        features = EntityUtil.orderBy(features, UtilMisc.toList("description"));
    } catch (GenericEntityException e) {
        Debug.logError(e, module);
        features = FastList.newInstance();
    }
    return features;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:25,代码来源:ProductWorker.java

示例6: getAvailableOrderHeaderAdjustments

import javolution.util.FastList; //导入依赖的package包/类
/**
 * Get orderAdjustments that have no corresponding returnAdjustment
 * 
 * @return return the order adjustments that have no corresponding with
 *         return adjustment
 */
public List<GenericValue> getAvailableOrderHeaderAdjustments() {
    List<GenericValue> orderHeaderAdjustments = this.getOrderHeaderAdjustments();
    List<GenericValue> filteredAdjustments = FastList.newInstance();
    if (orderHeaderAdjustments != null) {
        for (GenericValue orderAdjustment : orderHeaderAdjustments) {
            long count = 0;
            try {
                count = orderHeader.getDelegator().findCountByCondition("ReturnAdjustment",
                        EntityCondition.makeCondition("orderAdjustmentId", EntityOperator.EQUALS, orderAdjustment.get("orderAdjustmentId")), null, null);
            } catch (GenericEntityException e) {
                Debug.logError(e, module);
            }
            if (count == 0) {
                filteredAdjustments.add(orderAdjustment);
            }
        }
    }
    return filteredAdjustments;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:26,代码来源:OrderReadHelper.java

示例7: run

import javolution.util.FastList; //导入依赖的package包/类
@Override
public void run() {
    boolean needDay = false;
    boolean needHour = false;
    boolean needMinute = false;
    Date tm = new Date();
    if (lastDay != tm.getDay()) {
        lastDay = tm.getDay();
        needDay = true;
    }
    if (lastHour != tm.getHours()) {
        lastHour = tm.getHours();
        needHour = true;
    }
    if (lastMinute != tm.getMinutes()) {
        lastMinute = tm.getMinutes();
        needMinute = true;
    }

    for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
        Esme esme = n.getValue();
        if (needDay) {
            esme.clearDayMsgCounter();
        } else if (needHour) {
            esme.clearHourMsgCounter();
        } else if (needMinute) {
            esme.clearMinuteMsgCounter();
        } else {
            esme.clearSecondMsgCounter();
        }
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:33,代码来源:EsmeManagement.java

示例8: addConstraint

import javolution.util.FastList; //导入依赖的package包/类
@Override
public void addConstraint(ProductSearchContext productSearchContext) {
    List<String> productCategoryIds = FastList.newInstance();
    for (GenericValue category: productCategories) {
        productCategoryIds.add(category.getString("productCategoryId"));
    }

    // make index based values and increment
    String entityAlias = "PCM" + productSearchContext.index;
    String prefix = "pcm" + productSearchContext.index;
    productSearchContext.index++;

    productSearchContext.dynamicViewEntity.addMemberEntity(entityAlias, "ProductCategoryMember");
    productSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "ProductCategoryId", "productCategoryId", null, null, null, null);
    productSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "FromDate", "fromDate", null, null, null, null);
    productSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "ThruDate", "thruDate", null, null, null, null);
    productSearchContext.dynamicViewEntity.addViewLink("PROD", entityAlias, Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
    productSearchContext.entityConditionList.add(EntityCondition.makeCondition(prefix + "ProductCategoryId", EntityOperator.IN, productCategoryIds));
    productSearchContext.entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition(prefix + "ThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition(prefix + "ThruDate", EntityOperator.GREATER_THAN, productSearchContext.nowTimestamp)));
    productSearchContext.entityConditionList.add(EntityCondition.makeCondition(prefix + "FromDate", EntityOperator.LESS_THAN, productSearchContext.nowTimestamp));

    // add in productSearchConstraint, don't worry about the productSearchResultId or constraintSeqId, those will be fill in later
    productSearchContext.productSearchConstraintList.add(productSearchContext.getDelegator().makeValue("ProductSearchConstraint", UtilMisc.toMap("constraintName", constraintName, "infoString", this.prodCatalogId)));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:25,代码来源:ProductSearch.java

示例9: getAllCatalogIds

import javolution.util.FastList; //导入依赖的package包/类
public static List<String> getAllCatalogIds(ServletRequest request) {
    List<String> catalogIds = FastList.newInstance();
    List<GenericValue> catalogs = null;
    Delegator delegator = (Delegator) request.getAttribute("delegator");
    try {
        catalogs = EntityQuery.use(delegator).from("ProdCatalog").orderBy("catalogName").queryList();
    } catch (GenericEntityException e) {
        Debug.logError(e, "Error looking up all catalogs", module);
    }
    if (catalogs != null) {
        for (GenericValue c: catalogs) {
            catalogIds.add(c.getString("prodCatalogId"));
        }
    }
    return catalogIds;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:17,代码来源:CatalogWorker.java

示例10: store

import javolution.util.FastList; //导入依赖的package包/类
/**
 * Persist
 */
public void store() {

    // TODO : Should we keep reference to Objects rather than recreating
    // everytime?
    try {
        XMLObjectWriter writer = XMLObjectWriter.newInstance(new FileOutputStream(persistFile.toString()));
        writer.setBinding(binding);
        // Enables cross-references.
        // writer.setReferenceResolver(new XMLReferenceResolver());
        writer.setIndentation(TAB_INDENT);
        writer.write(esmes, ESME_LIST, FastList.class);

        writer.close();
    } catch (Exception e) {
        logger.error("Error while persisting the Rule state in file", e);
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:21,代码来源:EsmeManagement.java

示例11: isCategoryContainsProduct

import javolution.util.FastList; //导入依赖的package包/类
/**
 * SCIPIO: Returns true only if the category ID is a top category.
 * <p>
 * NOTE: is caching
 */
public static boolean isCategoryContainsProduct(Delegator delegator, LocalDispatcher dispatcher, String productCategoryId, String productId) {
    if (UtilValidate.isEmpty(productCategoryId) || UtilValidate.isEmpty(productId)) {
        return false;
    }
    try {
        List<EntityCondition> conds = FastList.newInstance();
        conds.add(EntityCondition.makeCondition("productCategoryId", productCategoryId));
        conds.add(EntityCondition.makeCondition("productId", productId));
        List<GenericValue> productCategoryMembers = EntityQuery.use(delegator).select("productCategoryId").from("ProductCategoryMember")
                .where(conds).filterByDate().cache(true).queryList();
        return !productCategoryMembers.isEmpty();
    } catch (GenericEntityException e) {
        Debug.logWarning(e, module);
    }
    return false; // can't tell, return false to play it safe
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:22,代码来源:CategoryWorker.java

示例12: PackingSession

import javolution.util.FastList; //导入依赖的package包/类
public PackingSession(LocalDispatcher dispatcher, GenericValue userLogin, String facilityId, String binId, String orderId, String shipGrp) {
    this._dispatcher = dispatcher;
    this.dispatcherName = dispatcher.getName();

    this._delegator = _dispatcher.getDelegator();
    this.delegatorName = _delegator.getDelegatorName();

    this.primaryOrderId = orderId;
    this.primaryShipGrp = shipGrp;
    this.picklistBinId = binId;
    this.userLogin = userLogin;
    this.facilityId = facilityId;
    this.packLines = FastList.newInstance();
    this.packEvents = FastList.newInstance();
    this.itemInfos = FastList.newInstance();
    this.packageSeq = 1;
    this.packageWeights = FastMap.newInstance();
    this.shipmentBoxTypes = FastMap.newInstance();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:PackingSession.java

示例13: getItemSurveyInfo

import javolution.util.FastList; //导入依赖的package包/类
/**
 * Returns a list of survey response IDs for a shopping list item
 */
public static List<String> getItemSurveyInfo(GenericValue item) {
    List<String> responseIds = FastList.newInstance();
    List<GenericValue> surveyResp = null;
    try {
        surveyResp = item.getRelated("ShoppingListItemSurvey", null, null, false);
    } catch (GenericEntityException e) {
        Debug.logError(e, module);
    }

    if (UtilValidate.isNotEmpty(surveyResp)) {
        for (GenericValue resp : surveyResp) {
            responseIds.add(resp.getString("surveyResponseId"));
        }
    }

    return responseIds;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:21,代码来源:ShoppingListEvents.java

示例14: checkReservations

import javolution.util.FastList; //导入依赖的package包/类
protected void checkReservations(boolean ignore) throws GeneralException {
    List<String> errors = FastList.newInstance();
    for (PackingSessionLine line: this.getLines()) {
        BigDecimal reservedQty =  this.getCurrentReservedQuantity(line.getOrderId(), line.getOrderItemSeqId(), line.getShipGroupSeqId(), line.getProductId());
        BigDecimal packedQty = this.getPackedQuantity(line.getOrderId(), line.getOrderItemSeqId(), line.getShipGroupSeqId(), line.getProductId());

        if (packedQty.compareTo(reservedQty) != 0) {
            errors.add("Packed amount does not match reserved amount for item (" + line.getProductId() + ") [" + packedQty + " / " + reservedQty + "]");
        }
    }

    if (errors.size() > 0) {
        if (!ignore) {
            throw new GeneralException("Attempt to pack order failed.", errors);
        } else {
            Debug.logWarning("Packing warnings: " + errors, module);
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:PackingSession.java

示例15: BOMNode

import javolution.util.FastList; //导入依赖的package包/类
public BOMNode(GenericValue product, LocalDispatcher dispatcher, GenericValue userLogin) {
    this.product = product;
    this.delegator = product.getDelegator();
    this.dispatcher = dispatcher;
    this.userLogin = userLogin;
    children = FastList.newInstance();
    childrenNodes = FastList.newInstance();
    parentNode = null;
    productForRules = null;
    bomTypeId = null;
    quantityMultiplier = BigDecimal.ONE;
    scrapFactor = BigDecimal.ONE;
    // Now we initialize the fields used in breakdowns
    depth = 0;
    quantity = BigDecimal.ZERO;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:17,代码来源:BOMNode.java


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