/[classpath]/classpath/java/awt/BasicStroke.java
ViewVC logotype

Diff of /classpath/java/awt/BasicStroke.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mkoch, Tue Nov 16 09:59:11 2004 UTC revision 1.6 by mark, Thu Jan 20 12:40:44 2005 UTC
# Line 1  Line 1 
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    
# Line 48  public class BasicStroke implements Stro Line 48  public class BasicStroke implements Stro
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;
# Line 208  public class BasicStroke implements Stro Line 209  public class BasicStroke implements Stro
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))

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26