Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Watts committed Nov 15, 2012
1 parent 583bedf commit ab70bb0
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions crono/src/crono/type/TypeId.java
Expand Up @@ -2,46 +2,46 @@


public class TypeId extends Atom { public class TypeId extends Atom {
public static final TypeId TYPEID = new TypeId(":type-id", TypeId.class, public static final TypeId TYPEID = new TypeId(":type-id", TypeId.class,
Atom.TYPEID); Atom.TYPEID);

public final String image; public final String image;
public final Class type; public final Class type;

public final TypeId parent; public final TypeId parent;

public TypeId(String image, Class type) { public TypeId(String image, Class type) {
this(image, type, null); this(image, type, null);
} }
public TypeId(String image, Class type, TypeId parent) { public TypeId(String image, Class type, TypeId parent) {
this.type = type; this.type = type;
this.image = image; this.image = image;
this.parent = parent; this.parent = parent;
} }

public boolean isType(CronoType object) { public boolean isType(CronoType object) {
TypeId id = object.typeId(); TypeId id = object.typeId();
while(id != null) { while(id != null) {
if(this.equals(id)) { if(this.equals(id)) {
return true; return true;
} }
id = id.parent; id = id.parent;
} }
return false; return false;
} }

public boolean equals(Object o) { public boolean equals(Object o) {
return ((o instanceof TypeId) && return ((o instanceof TypeId) &&
type.equals(((TypeId)o).type) && type.equals(((TypeId)o).type) &&
image.equals(((TypeId)o).image)); image.equals(((TypeId)o).image));
} }

public TypeId typeId() { public TypeId typeId() {
return TypeId.TYPEID; return TypeId.TYPEID;
} }
public String toString() { public String toString() {
if(isQuoted()) { if(isQuoted()) {
return "'" + image; return "'" + image;
} }
return image; return image;
} }
} }

0 comments on commit ab70bb0

Please sign in to comment.