fr.lri.swingstates.sm
Class Tag

java.lang.Object
  extended by fr.lri.swingstates.sm.Tag
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
ATag, CTag, JTag

public abstract class Tag
extends java.lang.Object
implements java.util.Iterator

Tags are labels associated to objects or animations.

A tag is an object corresponding to a set of objects that can be browsed (i.e. a collection and an iterator on it).

Some tags are extensional (CExtensionalTag and JExtensionalTag), they can be explicitely attached to and detached from an object, i.e. an object can be added to or removed from the tag's collection. Some other tags are intentional and can not be explicitely added or removed, they tag objects that verify a given property. Thus, the collection of objects tagged by an intentional tag is computed at each use of this tag.

A tag can be attached to any number of objects. An object have any number of tags attached to it.

Tags are used for two main purposes : grouping and interaction.

Author:
Caroline Appert

Constructor Summary
Tag()
           
 
Method Summary
 java.util.Collection<java.lang.Object> getCollection()
           
abstract  boolean hasNext()
          Tests if there is other objects tagged by this tag.
abstract  java.lang.Object next()
          
 void remove()
          This methods is not supported by a Tag.
abstract  void reset()
          Inits the tag's iterator.
 int size()
          Counts how many objects are tagged by this tag.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Method Detail

getCollection

public java.util.Collection<java.lang.Object> getCollection()
Returns:
shapes tagged by this tag as a collection.

reset

public abstract void reset()
Inits the tag's iterator.


hasNext

public abstract boolean hasNext()
Tests if there is other objects tagged by this tag.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there is other objects tagged by this tag, false otherwise.
See Also:
Iterator.hasNext()

next

public abstract java.lang.Object next()

Specified by:
next in interface java.util.Iterator

remove

public final void remove()
This methods is not supported by a Tag. To remove a tag of a shape, take a look at removeFrom

Specified by:
remove in interface java.util.Iterator
See Also:
CExtensionalTag.removeFrom(fr.lri.swingstates.canvas.CShape)

size

public final int size()
Counts how many objects are tagged by this tag.

Returns:
the number of objects that are tagged by this tag.