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