|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.ddg.Primitive
public class Primitive
An abstract geometric primitive that is part of an object description (like "line l2"). Stores the type and the name of the primitive in the drawing.
Primitive.java Created: Sat Nov 20 21:36:00 2001
| Field Summary | |
|---|---|
static int |
ARC
|
static int |
ELLIPSE
|
static int |
GROUP
|
static int |
LINE
|
static int |
POINT
|
static int |
UNKNOWN
|
| Constructor Summary | |
|---|---|
Primitive(int type,
java.lang.String name)
Constructs the primitive of the type and name |
|
Primitive(java.lang.String type,
java.lang.String name)
Constructs the primitive of the type and name |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone the primitive |
static Primitive |
convertFrom(GeometricObject o,
int index)
Constructs a primitive from a given object with index in the name. |
boolean |
equals(java.lang.Object p)
The two primitives are the same if their name and type are the same. |
int |
hashCode()
The hashcode of a primitive is a hash code of it's string description. |
java.lang.String |
name()
Name of the primitive (like "l2" in "line l2") |
java.lang.String |
toString()
String description of the primitive (like "line l2") - includes both type and name |
int |
type()
Type of the primitive (like "line" in "line l2") |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNKNOWN
public static final int POINT
public static final int LINE
public static final int ELLIPSE
public static final int ARC
public static final int GROUP
| Constructor Detail |
|---|
public Primitive(int type,
java.lang.String name)
public Primitive(java.lang.String type,
java.lang.String name)
| Method Detail |
|---|
public static Primitive convertFrom(GeometricObject o,
int index)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object p)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String name()
public int type()
public java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||