view
Class AbstractFilledShape

java.lang.Object
  extended by view.AbstractFilledShape
All Implemented Interfaces:
FilledShape
Direct Known Subclasses:
PointDraw, ShapeDraw, TextDraw

public abstract class AbstractFilledShape
extends Object
implements FilledShape

Class that supports generic key generation for subclasses that cannot provide their own.


Field Summary
private static int COUNT
          An internal counter for automatic naming.
private  Object key
          The hopefully unique key.
 
Constructor Summary
protected AbstractFilledShape(Object unique)
          Constructs a new indexed shape.
 
Method Summary
 boolean equals(Object that)
          We are equal, if the keys are equal.
 Object getUnique()
          Return the unique key.
 int hashCode()
          Hash is the hash from our unique key.
private static int nextCount()
          Gets the next available number at automatic naming.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface view.FilledShape
getShape, isFilled
 

Field Detail

COUNT

private static int COUNT
An internal counter for automatic naming.


key

private Object key
The hopefully unique key.

Constructor Detail

AbstractFilledShape

protected AbstractFilledShape(Object unique)
Constructs a new indexed shape. If the key is null, a running number is generated and used for the key.

Method Detail

nextCount

private static int nextCount()
Gets the next available number at automatic naming.


getUnique

public Object getUnique()
Return the unique key.

Specified by:
getUnique in interface FilledShape

hashCode

public int hashCode()
Hash is the hash from our unique key.

Overrides:
hashCode in class Object

equals

public boolean equals(Object that)
We are equal, if the keys are equal.

Overrides:
equals in class Object