1 |
/* BasicStroke.java -- |
/* BasicStroke.java -- |
2 |
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. |
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
48 |
public static final int JOIN_MITER = 0; |
public static final int JOIN_MITER = 0; |
49 |
public static final int JOIN_ROUND = 1; |
public static final int JOIN_ROUND = 1; |
50 |
public static final int JOIN_BEVEL = 2; |
public static final int JOIN_BEVEL = 2; |
51 |
|
|
52 |
public static final int CAP_BUTT = 0; |
public static final int CAP_BUTT = 0; |
53 |
public static final int CAP_ROUND = 1; |
public static final int CAP_ROUND = 1; |
54 |
public static final int CAP_SQUARE = 2; |
public static final int CAP_SQUARE = 2; |
209 |
return phase; |
return phase; |
210 |
} |
} |
211 |
|
|
212 |
|
/** |
213 |
|
* Returns the hash code for this object. The hash is calculated by |
214 |
|
* xoring the hash, cap, join, limit, dash array and phase values |
215 |
|
* (converted to <code>int</code> first with |
216 |
|
* <code>Float.floatToIntBits()</code> if the value is a |
217 |
|
* <code>float</code>). |
218 |
|
*/ |
219 |
public int hashCode() |
public int hashCode() |
220 |
{ |
{ |
221 |
throw new Error("not implemented"); |
int hash = Float.floatToIntBits(width); |
222 |
|
hash ^= cap; |
223 |
|
hash ^= join; |
224 |
|
hash ^= Float.floatToIntBits(limit); |
225 |
|
|
226 |
|
for (int i = 0; i < dash.length; i++) |
227 |
|
hash ^= Float.floatToIntBits(dash[i]); |
228 |
|
|
229 |
|
hash ^= Float.floatToIntBits(phase); |
230 |
|
|
231 |
|
return hash; |
232 |
} |
} |
233 |
|
|
234 |
|
/** |
235 |
|
* Returns true if the given Object is an instance of BasicStroke |
236 |
|
* and the width, cap, join, limit, dash array and phase are all |
237 |
|
* equal. |
238 |
|
*/ |
239 |
public boolean equals(Object o) |
public boolean equals(Object o) |
240 |
{ |
{ |
241 |
if (! (o instanceof BasicStroke)) |
if (! (o instanceof BasicStroke)) |