infomat.vectorspace
Class IObjectGrouping

java.lang.Object
  extended by infomat.vectorspace.IObject
      extended by infomat.vectorspace.IObjectGroup
          extended by infomat.vectorspace.IObjectGrouping

public class IObjectGrouping
extends IObjectGroup

A IObjectGrouping is a set of IObjectGroup:s. It is ordered in a Vector. The order is deemed important. OBS. A IObjectGrouping is only implicitely connected to a IObjectSet. If the IObjectSet is altered this is not reflected in the IObjectGrouping.

Version:
070314
Author:
Magnus Rosell

Field Summary
static int groupingMaxIdSoFar
           
 
Fields inherited from class infomat.vectorspace.IObjectGroup
maxIdSoFar, objectOrderIndexMap
 
Constructor Summary
IObjectGrouping(java.lang.String groupingName)
           
IObjectGrouping(java.lang.String groupingName, int groupingId)
           
 
Method Summary
 void add(IObjectGroup cog)
          Adds a IObjectGroup at the next place.
 java.util.Vector<IObject> getGroupingVector()
          Returns a vector of all the IObjects contained in this IObjectGrouping in the order suggested by the ordering of the IObjectGroup:s and their internal order.
 java.util.Vector<java.lang.Integer> getGroupLimitsForIntervall(int from, int to)
          Returns a vector with integers that indicate where the boundaries for the IObjectsGroups are in the entire ordered vector "groupOrdered".
 java.util.Vector<IObjectGroup> getGroups()
          Returns the ordered IObjectGroup:s in a vector.
 java.util.Vector<IObjectGroup> getGroupsForIntervall(int from, int to)
          Returns a vector of IObjectGroups that lie within the intervall given.
 IObjectGroup inWhichIObjectGroup(IObject co)
          Returns the IObjectGroup in this IObjectGrouping that contains this IObject.
 int inWhichIObjectGroupOrdered(IObject co)
          Returns the number of the IObjectGroup in this IObjectGrouping that contains this IObject.
 int numberOfIObjectGroups()
          Returns the the number of IObjectGroup:s in the IObjectGrouping.
 java.util.Vector<IObject> remove(int from, int to)
          Removes and returns the IObjects in the range given, the range within the vector "ordered".
 void removeEmptyGroups()
          Removes all empty IObjectGroup:s.
 void reorder(int[] mapping)
          Reorders the groups according to a mapping in the form of an int array.
 void sort()
          Sorts all IObjectGroup:s in their internal order and sorts the IObject:s in that order in the "ordered" vector.
 
Methods inherited from class infomat.vectorspace.IObjectGroup
add, add, contains, getIObjectAt, getIObjectOrderIndex, getName, getObjectOrderValueMap, getOrdered, getRepresentation, numberOfIObjects, removeAll, setName, sortInOrderValueOrder
 
Methods inherited from class infomat.vectorspace.IObject
getID, getKind, getString, setString, stringCompareTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groupingMaxIdSoFar

public static int groupingMaxIdSoFar
Constructor Detail

IObjectGrouping

public IObjectGrouping(java.lang.String groupingName,
                       int groupingId)

IObjectGrouping

public IObjectGrouping(java.lang.String groupingName)
Method Detail

add

public void add(IObjectGroup cog)
Adds a IObjectGroup at the next place.


removeEmptyGroups

public void removeEmptyGroups()
Removes all empty IObjectGroup:s. Some algorithms may produce empty groups. The interface does not handle empty groups.


getGroups

public java.util.Vector<IObjectGroup> getGroups()
Returns the ordered IObjectGroup:s in a vector.


reorder

public void reorder(int[] mapping)
Reorders the groups according to a mapping in the form of an int array. Does not do any check of the mapping.


numberOfIObjectGroups

public int numberOfIObjectGroups()
Returns the the number of IObjectGroup:s in the IObjectGrouping.


getGroupingVector

public java.util.Vector<IObject> getGroupingVector()
Returns a vector of all the IObjects contained in this IObjectGrouping in the order suggested by the ordering of the IObjectGroup:s and their internal order.


inWhichIObjectGroup

public IObjectGroup inWhichIObjectGroup(IObject co)
Returns the IObjectGroup in this IObjectGrouping that contains this IObject.


inWhichIObjectGroupOrdered

public int inWhichIObjectGroupOrdered(IObject co)
Returns the number of the IObjectGroup in this IObjectGrouping that contains this IObject.


sort

public void sort()
Sorts all IObjectGroup:s in their internal order and sorts the IObject:s in that order in the "ordered" vector.

See Also:
IObjectGroup.sortInOrderValueOrder()

remove

public java.util.Vector<IObject> remove(int from,
                                        int to)
Removes and returns the IObjects in the range given, the range within the vector "ordered".


getGroupLimitsForIntervall

public java.util.Vector<java.lang.Integer> getGroupLimitsForIntervall(int from,
                                                                      int to)
Returns a vector with integers that indicate where the boundaries for the IObjectsGroups are in the entire ordered vector "groupOrdered". The next integer is the first in the next group. Used in SparsePictureConstructor.

See Also:
SparsePictureConstructor

getGroupsForIntervall

public java.util.Vector<IObjectGroup> getGroupsForIntervall(int from,
                                                            int to)
Returns a vector of IObjectGroups that lie within the intervall given. The intervall is within the ordered vector "groupOrdered". Used in SparsePictureConstructor together with #getGroupLimitsForIntervall.

See Also:
SparsePictureConstructor