infomat.vectorspace
Class IObjectGroup

java.lang.Object
  extended by infomat.vectorspace.IObject
      extended by infomat.vectorspace.IObjectGroup
Direct Known Subclasses:
IObjectGrouping, IObjectSet

public class IObjectGroup
extends IObject

A IObjectGroup is a set of IObject:s.

Version:
070314
Author:
Magnus Rosell

Field Summary
static int maxIdSoFar
           
 java.util.HashMap<IObject,java.lang.Integer> objectOrderIndexMap
           
 
Constructor Summary
IObjectGroup(java.lang.String name)
           
IObjectGroup(java.lang.String name, int id)
           
 
Method Summary
 void add(IObject co)
          Adds a new IObject at the next place.
 void add(IObject co, float orderValue)
          Adds a new IObject in the place the value implicates.
 boolean contains(IObject co)
          Returns true when the IObjectGroup contains the IObject.
 IObject getIObjectAt(int i)
          Returns the IObject at the i:the place according to the ordering.
 int getIObjectOrderIndex(IObject co)
          Returns the order number of the IObject.
 java.lang.String getName()
          Returns the name of thie IObjectGroup.
 java.util.HashMap<IObject,java.lang.Float> getObjectOrderValueMap()
          Returns a HashMap with the objects mapped to the values that are the basis for the ordering.
 java.util.Vector<IObject> getOrdered()
          Returns a vector of the ordered IObjects.
 java.util.HashMap<IObject,java.lang.Float> getRepresentation(IMatrix matrix)
          Returns a centroid in the form of a HashMap, mapping IObject to a Float value.
 int numberOfIObjects()
          Returns the number of IObjects in the IObjectGroup.
 void removeAll()
           
 void setName(java.lang.String name)
           
 void sortInOrderValueOrder()
          Sorts the IObjects in the vector "ordered" according to the values they have.
 
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

maxIdSoFar

public static int maxIdSoFar

objectOrderIndexMap

public java.util.HashMap<IObject,java.lang.Integer> objectOrderIndexMap
Constructor Detail

IObjectGroup

public IObjectGroup(java.lang.String name)

IObjectGroup

public IObjectGroup(java.lang.String name,
                    int id)
Method Detail

add

public void add(IObject co,
                float orderValue)
Adds a new IObject in the place the value implicates. For the object to get the right place the group has to be sorted through sortInOrderValueOrder().


add

public void add(IObject co)
Adds a new IObject at the next place.


removeAll

public void removeAll()

contains

public boolean contains(IObject co)
Returns true when the IObjectGroup contains the IObject. False otherwise.


numberOfIObjects

public int numberOfIObjects()
Returns the number of IObjects in the IObjectGroup.


getName

public java.lang.String getName()
Returns the name of thie IObjectGroup.


setName

public void setName(java.lang.String name)

getIObjectAt

public IObject getIObjectAt(int i)
Returns the IObject at the i:the place according to the ordering.

See Also:
sortInOrderValueOrder()

getIObjectOrderIndex

public int getIObjectOrderIndex(IObject co)
Returns the order number of the IObject. If it is not present -1 is returned.

See Also:
sortInOrderValueOrder()

getOrdered

public java.util.Vector<IObject> getOrdered()
Returns a vector of the ordered IObjects.

See Also:
sortInOrderValueOrder()

getObjectOrderValueMap

public java.util.HashMap<IObject,java.lang.Float> getObjectOrderValueMap()
Returns a HashMap with the objects mapped to the values that are the basis for the ordering.

Returns:
a HashMap

sortInOrderValueOrder

public void sortInOrderValueOrder()
Sorts the IObjects in the vector "ordered" according to the values they have.


getRepresentation

public java.util.HashMap<IObject,java.lang.Float> getRepresentation(IMatrix matrix)
Returns a centroid in the form of a HashMap, mapping IObject to a Float value.

Overrides:
getRepresentation in class IObject