本文整理汇总了C#中biz.ritter.javapi.clone方法的典型用法代码示例。如果您正苦于以下问题:C# biz.ritter.javapi.clone方法的具体用法?C# biz.ritter.javapi.clone怎么用?C# biz.ritter.javapi.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类biz.ritter.javapi
的用法示例。
在下文中一共展示了biz.ritter.javapi.clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getInstance
/**
* Transformer method that performs validation.
*
* @param paramTypes the constructor parameter types
* @param args the constructor arguments
* @return an instantiate transformer
*/
public static Transformer getInstance(java.lang.Class[] paramTypes, Object[] args)
{
if (((paramTypes == null) && (args != null))
|| ((paramTypes != null) && (args == null))
|| ((paramTypes != null) && (args != null) && (paramTypes.Length != args.Length)))
{
throw new java.lang.IllegalArgumentException("Parameter types must match the arguments");
}
if (paramTypes == null || paramTypes.Length == 0)
{
return NO_ARG_INSTANCE;
}
else
{
paramTypes = (java.lang.Class[])paramTypes.clone();
args = (Object[])args.clone();
}
return new InstantiateTransformer(paramTypes, args);
}
开发者ID:gadfly,项目名称:nofs,代码行数:27,代码来源:org.apache.commons.collections.functors.InstantiateTransformer.cs
示例2: getTimeInMillis
/**
* <p>Returns the length of the duration in milli-seconds.</p>
*
* <p>If the seconds field carries more digits than milli-second order,
* those will be simply discarded (or in other words, rounded to zero.)
* For example, for any Calendar value <code>x</code>,</p>
* <pre>
* <code>new Duration("PT10.00099S").getTimeInMills(x) == 10000</code>.
* <code>new Duration("-PT10.00099S").getTimeInMills(x) == -10000</code>.
* </pre>
*
* <p/>
* Note that this method uses the {@link #addTo(Calendar)} method,
* which may work incorrectly with <code>Duration</code> objects with
* very large values in its fields. See the {@link #addTo(Calendar)}
* method for details.
*
* @param startInstant
* The length of a month/year varies. The <code>startInstant</code> is
* used to disambiguate this variance. Specifically, this method
* returns the difference between <code>startInstant</code> and
* <code>startInstant+duration</code>
*
* @return milliseconds between <code>startInstant</code> and
* <code>startInstant</code> plus this <code>Duration</code>
*
* @throws NullPointerException if <code>startInstant</code> parameter
* is null.
*
*/
public long getTimeInMillis(java.util.Calendar startInstant)
{
java.util.Calendar cal = (java.util.Calendar)startInstant.clone();
addTo(cal);
return getCalendarTimeInMillis(cal)
- getCalendarTimeInMillis(startInstant);
}
示例3: getInstance
/**
* Factory method that performs validation.
*
* @param classToInstantiate the class to instantiate, not null
* @param paramTypes the constructor parameter types
* @param args the constructor arguments
* @return a new instantiate factory
*/
public static Factory getInstance(java.lang.Class classToInstantiate, java.lang.Class[] paramTypes, Object[] args)
{
if (classToInstantiate == null)
{
throw new java.lang.IllegalArgumentException("Class to instantiate must not be null");
}
if (((paramTypes == null) && (args != null))
|| ((paramTypes != null) && (args == null))
|| ((paramTypes != null) && (args != null) && (paramTypes.Length != args.Length)))
{
throw new java.lang.IllegalArgumentException("Parameter types must match the arguments");
}
if (paramTypes == null || paramTypes.Length == 0)
{
return new InstantiateFactory(classToInstantiate);
}
else
{
paramTypes = (java.lang.Class[])paramTypes.clone();
args = (Object[])args.clone();
return new InstantiateFactory(classToInstantiate, paramTypes, args);
}
}