本文整理汇总了Java中org.jfree.util.PaintList.size方法的典型用法代码示例。如果您正苦于以下问题:Java PaintList.size方法的具体用法?Java PaintList.size怎么用?Java PaintList.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.util.PaintList
的用法示例。
在下文中一共展示了PaintList.size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hashCode
import org.jfree.util.PaintList; //导入方法依赖的package包/类
/**
* Computes a hash code for a {@link PaintList}. In the latest version
* of JCommon, the {@link PaintList} class should implement the hashCode()
* method correctly, but we compute it here anyway so that we can work with
* older versions of JCommon (back to 1.0.0).
*
* @param pre the seed value.
* @param list the list (<code>null</code> permitted).
*
* @return The hash code.
*
* @since 1.0.9
*/
public static int hashCode(int pre, PaintList list) {
if (list == null) {
return pre;
}
int result = 127;
int size = list.size();
result = HashUtilities.hashCode(result, size);
// for efficiency, we just use the first, last and middle items to
// compute a hashCode...
if (size > 0) {
result = HashUtilities.hashCode(result, list.getPaint(0));
if (size > 1) {
result = HashUtilities.hashCode(result,
list.getPaint(size - 1));
if (size > 2) {
result = HashUtilities.hashCode(result,
list.getPaint(size / 2));
}
}
}
return 37 * pre + result;
}