~ubuntu-branches/ubuntu/gutsy/cairo-java/gutsy

« back to all changes in this revision

Viewing changes to src/java/org/freedesktop/cairo/LineJoin.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-04-16 16:15:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060416161530-avdw6l5vg6n2kosy
Tags: upstream-1.0.3
ImportĀ upstreamĀ versionĀ 1.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Java-Gnome Bindings Library
 
3
 *
 
4
 * Copyright 1998-2005 the Java-Gnome Team, all rights reserved.
 
5
 *
 
6
 * The Java-Gnome bindings library is free software distributed under
 
7
 * the terms of the GNU Library General Public License version 2.
 
8
 */
 
9
package org.freedesktop.cairo;
 
10
 
 
11
import org.gnu.glib.Enum;
 
12
 
 
13
public class LineJoin extends Enum {
 
14
 
 
15
    static final private int _MITER = 0;
 
16
 
 
17
    static final public LineJoin MITER = new LineJoin(_MITER);
 
18
 
 
19
    static final private int _ROUND = 1;
 
20
 
 
21
    static final public LineJoin ROUND = new LineJoin(_ROUND);
 
22
 
 
23
    static final private int _BEVEL = 2;
 
24
 
 
25
    static final public LineJoin BEVEL = new LineJoin(_BEVEL);
 
26
 
 
27
    static final private LineJoin[] theInterned = new LineJoin[] { MITER,
 
28
            ROUND, BEVEL };
 
29
 
 
30
    static private java.util.Hashtable theInternedExtras;
 
31
 
 
32
    static final private LineJoin theSacrificialOne = new LineJoin(0);
 
33
 
 
34
    static public LineJoin intern(int value) {
 
35
        if (value < theInterned.length) {
 
36
            return theInterned[value];
 
37
        }
 
38
        theSacrificialOne.value_ = value;
 
39
        if (theInternedExtras == null) {
 
40
            theInternedExtras = new java.util.Hashtable();
 
41
        }
 
42
        LineJoin already = (LineJoin) theInternedExtras.get(theSacrificialOne);
 
43
        if (already == null) {
 
44
            already = new LineJoin(value);
 
45
            theInternedExtras.put(already, already);
 
46
        }
 
47
        return already;
 
48
    }
 
49
 
 
50
    private LineJoin(int value) {
 
51
        value_ = value;
 
52
    }
 
53
 
 
54
    public boolean test(LineJoin other) {
 
55
        return (value_ & other.value_) == other.value_;
 
56
    }
 
57
}