jjdh API

dh.java.math.algebra.structure.relation
Class AbstractPartition<E>

java.lang.Object
  extended by dh.java.math.algebra.structure.relation.AbstractPartition<E>
All Implemented Interfaces:
EquivalenceRelation<E>, GrowingPartition<E>, Partition<E>, Relation<E>
Direct Known Subclasses:
OrderedPartition, StupidPartition

public abstract class AbstractPartition<E>
extends Object
implements GrowingPartition<E>, EquivalenceRelation<E>


Field Summary
protected  boolean implicitGrow
          Indicates if this partition should grow whenever possible.
protected  SortedMap<E,UnsafeListSet<E>> mapping
          This map represents the main data structure of a partition.
protected  EquivalenceRelation<? super E> relation
          The Relation which defines this Partition.
protected  SortedSet<E> representatives
          A representative system of the equivalence classes of this partition.
 
Constructor Summary
AbstractPartition(EquivalenceRelation<? super E> relation, boolean implicitGrow)
           
 
Method Summary
 void addAll(Collection<? extends E> elements)
           
 void addAll(E... elements)
           
protected  void addNewClass(UnsafeListSet<E> value)
           
protected  void addToClass(UnsafeListSet<E> value, Collection<E> toAdd)
           
 String detailedToString()
           
 EquivalenceClass<E> getEquivalenceClass(E element)
           
 Set<EquivalenceClass<E>> getEquivalenceClasses()
           
 List<EquivalenceClass<E>> getEquivalenceClassesAsList()
           
 Set<E> getRepresentativeSystem()
           
 Set<E> getSuperset()
          Returns the implicit superset.
abstract  void processNewList(List<E> list)
           
 boolean related(E s1, E s2)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

relation

protected EquivalenceRelation<? super E> relation
The Relation which defines this Partition.


implicitGrow

protected boolean implicitGrow
Indicates if this partition should grow whenever possible.


mapping

protected SortedMap<E,UnsafeListSet<E>> mapping
This map represents the main data structure of a partition. It has to be constructed in subclasses.


representatives

protected SortedSet<E> representatives
A representative system of the equivalence classes of this partition. This attribute is not really needed, but useful to speed up this class. It has to be constructed in subclasses.

Constructor Detail

AbstractPartition

public AbstractPartition(EquivalenceRelation<? super E> relation,
                         boolean implicitGrow)
Method Detail

getSuperset

public Set<E> getSuperset()
Description copied from interface: Partition
Returns the implicit superset.

Specified by:
getSuperset in interface Partition<E>
Returns:
the implicit superset

getEquivalenceClass

public EquivalenceClass<E> getEquivalenceClass(E element)
Specified by:
getEquivalenceClass in interface Partition<E>

getRepresentativeSystem

public Set<E> getRepresentativeSystem()
Specified by:
getRepresentativeSystem in interface Partition<E>

getEquivalenceClasses

public Set<EquivalenceClass<E>> getEquivalenceClasses()
Specified by:
getEquivalenceClasses in interface Partition<E>

getEquivalenceClassesAsList

public List<EquivalenceClass<E>> getEquivalenceClassesAsList()

addAll

public void addAll(E... elements)
Specified by:
addAll in interface GrowingPartition<E>

addAll

public void addAll(Collection<? extends E> elements)
Specified by:
addAll in interface GrowingPartition<E>

processNewList

public abstract void processNewList(List<E> list)

addToClass

protected void addToClass(UnsafeListSet<E> value,
                          Collection<E> toAdd)

addNewClass

protected void addNewClass(UnsafeListSet<E> value)

toString

public String toString()
Overrides:
toString in class Object

detailedToString

public String detailedToString()

related

public boolean related(E s1,
                       E s2)
Specified by:
related in interface Relation<E>

jjdh API

Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.