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


Java Duration.subtract方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.repository.datatype.Duration.subtract方法的典型用法代码示例。如果您正苦于以下问题:Java Duration.subtract方法的具体用法?Java Duration.subtract怎么用?Java Duration.subtract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.repository.datatype.Duration的用法示例。


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

示例1: getOrderProperties

import org.alfresco.service.cmr.repository.datatype.Duration; //导入方法依赖的package包/类
/**
 * @return properties
 */
public Map<QName, Serializable> getOrderProperties()
{
    Map<QName, Serializable> testProperties = new HashMap<QName, Serializable>();
    testProperties.put(CREATED_DATE, orderDate);
    testProperties.put(ORDER_DOUBLE, orderDoubleCount);
    testProperties.put(ORDER_FLOAT, orderFloatCount);
    testProperties.put(ORDER_LONG, orderLongCount);
    testProperties.put(ORDER_INT, orderIntCount);
    testProperties.put(ORDER_TEXT, new String(new char[] { (char) ('a' + orderTextCount) }) + " cabbage");

    MLText mlText = new MLText();
    mlText.addValue(Locale.ENGLISH, new String(new char[] { (char) ('a' + orderTextCount) }) + " banana");
    mlText.addValue(Locale.FRENCH, new String(new char[] { (char) ('Z' - orderTextCount) }) + " banane");
    mlText.addValue(Locale.CHINESE, new String(new char[] { (char) ('香' + orderTextCount) }) + " 香蕉");
    testProperties.put(ORDER_ML_TEXT, mlText);

    orderDate = Duration.subtract(orderDate, new Duration("P1D"));
    orderDoubleCount += 0.1d;
    orderFloatCount += 0.82f;
    orderLongCount += 299999999999999l;
    orderIntCount += 8576457;
    orderTextCount++;
    return testProperties;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:DBQueryTest.java

示例2: getOrderProperties

import org.alfresco.service.cmr.repository.datatype.Duration; //导入方法依赖的package包/类
/**
 * @return properties
 */
public Map<QName, Serializable> getOrderProperties()
{
    Map<QName, Serializable> testProperties = new HashMap<QName, Serializable>();
    testProperties.put(createdDate, orderDate);
    testProperties.put(orderDouble, orderDoubleCount);
    testProperties.put(orderFloat, orderFloatCount);
    testProperties.put(orderLong, orderLongCount);
    testProperties.put(orderInt, orderIntCount);
    testProperties.put(orderText, new String(new char[] { (char) ('a' + orderTextCount) }) + " cabbage");

    MLText mlText = new MLText();
    mlText.addValue(Locale.ENGLISH, new String(new char[] { (char) ('a' + orderTextCount) }) + " banana");
    mlText.addValue(Locale.FRENCH, new String(new char[] { (char) ('Z' - orderTextCount) }) + " banane");
    mlText.addValue(Locale.CHINESE, new String(new char[] { (char) ('香' + orderTextCount) }) + " 香蕉");
    testProperties.put(orderMLText, mlText);

    orderDate = Duration.subtract(orderDate, new Duration("P1D"));
    orderDoubleCount += 0.1d;
    orderFloatCount += 0.82f;
    orderLongCount += 299999999999999l;
    orderIntCount += 8576457;
    orderTextCount++;
    return testProperties;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:28,代码来源:ADMLuceneTest.java

示例3: Ticket

import org.alfresco.service.cmr.repository.datatype.Duration; //导入方法依赖的package包/类
private Ticket(ExpiryMode expires, Date expiryDate, String userName, Duration validDuration, String ticketId)
{
    this.expires = expires;
    this.expiryDate = expiryDate;
    this.userName = userName;
    this.validDuration = validDuration;
    Duration tenPercent = validDuration.divide(10);
    this.testDuration = validDuration.subtract(tenPercent);
    this.ticketId = ticketId;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:11,代码来源:InMemoryTicketComponentImpl.java

示例4: getOrderProperties

import org.alfresco.service.cmr.repository.datatype.Duration; //导入方法依赖的package包/类
private Map<QName, PropertyValue> getOrderProperties()
{
    double orderDoubleCount = -0.11d + orderTextCount * ((orderTextCount % 2 == 0) ? 0.1d : -0.1d);
    float orderFloatCount = -3.5556f + orderTextCount * ((orderTextCount % 2 == 0) ? 0.82f : -0.82f);
    long orderLongCount = -1999999999999999l + orderTextCount
                * ((orderTextCount % 2 == 0) ? 299999999999999l : -299999999999999l);
    int orderIntCount = -45764576 + orderTextCount * ((orderTextCount % 2 == 0) ? 8576457 : -8576457);

    Map<QName, PropertyValue> testProperties = new HashMap<QName, PropertyValue>();
    testProperties.put(createdDate,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderDate)));
    testProperties.put(createdTime,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderDate)));
    testProperties.put(orderDouble,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderDoubleCount)));
    testProperties.put(orderFloat,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderFloatCount)));
    testProperties.put(orderLong,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderLongCount)));
    testProperties.put(orderInt,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderIntCount)));
    testProperties.put(
                orderText,
                new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, new String(
                            new char[] { (char) ('l' + ((orderTextCount % 2 == 0) ? orderTextCount
                                        : -orderTextCount)) })
                            + " cabbage")));

    testProperties.put(ContentModel.PROP_NAME, new StringPropertyValue(orderNames[orderTextCount]));
    testProperties.put(orderLocalisedText, new StringPropertyValue(orderLocalisedNames[orderTextCount]));

    MLTextPropertyValue mlTextPropLocalisedOrder = new MLTextPropertyValue();
    if (orderLocaliseMLText_en[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(Locale.ENGLISH, orderLocaliseMLText_en[orderTextCount]);
    }
    if (orderLocaliseMLText_fr[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(Locale.FRENCH, orderLocaliseMLText_fr[orderTextCount]);
    }
    if (orderLocaliseMLText_es[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(new Locale("es"), orderLocaliseMLText_es[orderTextCount]);
    }
    if (orderLocaliseMLText_de[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(Locale.GERMAN, orderLocaliseMLText_de[orderTextCount]);
    }
    testProperties.put(orderLocalisedMLText, mlTextPropLocalisedOrder);

    MLTextPropertyValue mlTextPropVal = new MLTextPropertyValue();
    mlTextPropVal.addValue(Locale.ENGLISH, new String(
                new char[] { (char) ('l' + ((orderTextCount % 2 == 0) ? orderTextCount : -orderTextCount)) })
                + " banana");
    mlTextPropVal.addValue(Locale.FRENCH, new String(
                new char[] { (char) ('L' + ((orderTextCount % 2 == 0) ? -orderTextCount : orderTextCount)) })
                + " banane");
    mlTextPropVal.addValue(Locale.CHINESE, new String(
                new char[] { (char) ('香' + ((orderTextCount % 2 == 0) ? orderTextCount : -orderTextCount)) })
                + " 香蕉");
    testProperties.put(orderMLText, mlTextPropVal);

    orderDate = Duration.subtract(orderDate, new Duration("P1D"));
    orderTextCount++;
    return testProperties;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:67,代码来源:AlfrescoCoreAdminTester.java

示例5: getOrderProperties

import org.alfresco.service.cmr.repository.datatype.Duration; //导入方法依赖的package包/类
private Map<QName, PropertyValue> getOrderProperties()
{
    double orderDoubleCount = -0.11d + orderTextCount * ((orderTextCount % 2 == 0) ? 0.1d : -0.1d);
    float orderFloatCount = -3.5556f + orderTextCount * ((orderTextCount % 2 == 0) ? 0.82f : -0.82f);
    long orderLongCount = -1999999999999999l + orderTextCount * ((orderTextCount % 2 == 0) ? 299999999999999l : -299999999999999l);
    int orderIntCount = -45764576 + orderTextCount * ((orderTextCount % 2 == 0) ? 8576457 : -8576457);

    Map<QName, PropertyValue> testProperties = new HashMap<QName, PropertyValue>();
    testProperties.put(createdDate, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderDate)));
    testProperties.put(createdTime, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderDate)));
    testProperties.put(orderDouble, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderDoubleCount)));
    testProperties.put(orderFloat, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderFloatCount)));
    testProperties.put(orderLong, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderLongCount)));
    testProperties.put(orderInt, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, orderIntCount)));
    testProperties.put(
            orderText,
            new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, new String(new char[] { (char) ('l' + ((orderTextCount % 2 == 0) ? orderTextCount
                    : -orderTextCount)) }) + " cabbage")));

    testProperties.put(ContentModel.PROP_NAME, new StringPropertyValue(orderNames[orderTextCount]));
    testProperties.put(orderLocalisedText, new StringPropertyValue(orderLocalisedNames[orderTextCount]));

    MLTextPropertyValue mlTextPropLocalisedOrder = new MLTextPropertyValue();
    if (orderLocaliseMLText_en[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(Locale.ENGLISH, orderLocaliseMLText_en[orderTextCount]);
    }
    if (orderLocaliseMLText_fr[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(Locale.FRENCH, orderLocaliseMLText_fr[orderTextCount]);
    }
    if (orderLocaliseMLText_es[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(new Locale("es"), orderLocaliseMLText_es[orderTextCount]);
    }
    if (orderLocaliseMLText_de[orderTextCount].length() > 0)
    {
        mlTextPropLocalisedOrder.addValue(Locale.GERMAN, orderLocaliseMLText_de[orderTextCount]);
    }
    testProperties.put(orderLocalisedMLText, mlTextPropLocalisedOrder);

    MLTextPropertyValue mlTextPropVal = new MLTextPropertyValue();
    mlTextPropVal.addValue(Locale.ENGLISH, new String(new char[] { (char) ('l' + ((orderTextCount % 2 == 0) ? orderTextCount : -orderTextCount)) }) + " banana");
    mlTextPropVal.addValue(Locale.FRENCH, new String(new char[] { (char) ('L' + ((orderTextCount % 2 == 0) ? -orderTextCount : orderTextCount)) }) + " banane");
    mlTextPropVal.addValue(Locale.CHINESE, new String(new char[] { (char) ('香' + ((orderTextCount % 2 == 0) ? orderTextCount : -orderTextCount)) }) + " 香蕉");
    testProperties.put(orderMLText, mlTextPropVal);

    orderDate = Duration.subtract(orderDate, new Duration("P1D"));
    orderTextCount++;
    return testProperties;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:52,代码来源:AlfrescoCoreAdminHandler.java


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