infomat.vectorspace
Class IObjectSet

java.lang.Object
  extended by infomat.vectorspace.IObject
      extended by infomat.vectorspace.IObjectGroup
          extended by infomat.vectorspace.IObjectSet
All Implemented Interfaces:
IVectorIndex

public class IObjectSet
extends IObjectGroup

A IObjectSet is a complete set of IObject:s. This can either be the complete set of objects one investigates or the complete feature set by which these objects are represented. In fact, this representations makes no difference between the two.


Field Summary
private  IObjectGrouping currentGrouping
           
private  java.util.Vector<IObjectGrouping> groupings
           
private  java.util.HashMap<java.lang.Integer,IObject> idIObjectMap
           
private static int idIterator
           
private  java.util.HashMap<java.lang.String,IObjectGrouping> nameGroupingMap
           
private  java.util.HashMap<java.lang.String,java.util.HashSet<IObject>> stringAmbiguousIObjectsMap
           
 
Fields inherited from class infomat.vectorspace.IObjectGroup
maxIdSoFar, objectOrderIndexMap, objectOrderValueMap, ordered
 
Constructor Summary
IObjectSet(IObjectSet ios)
          Copy constructor.
IObjectSet(java.lang.String name)
           
 
Method Summary
 void add(IObject io)
          Adds a new IObject.
 void add(IObject io, float orderValue)
          Adds a new IObject in the place the value implicates.
 boolean addGrouping(IObjectGrouping cog)
          Adds an IObjectGrouping.
 boolean containsIObjectGroup(IObjectGroup iog)
          Returns true if any of the IObjectGrouping:s that order this IObjectSet contains the IObjectGroup.
 boolean containsIObjectGrouping(IObjectGrouping ioging)
          Returns true if the IObjectGrouping orders this IObjectSet.
 IObjectGrouping getCurrentGrouping()
          Returns the current IObjectGrouping.
 java.util.Vector<IObjectGrouping> getGroupings()
          Returns all IObjectGrouping:s of this IObjectSet.
 IObjectGrouping getGroupingWithName(java.lang.String name)
          Returns the IObjectGrouping with the name given.
 IObject getIObjectWithId(int i)
          Returns the IObject with the given id.
 java.lang.String getLargestStartOfLocation()
           
 IObjectGrouping makeStartGrouping()
          Makes a IObjectGrouping consisting of one IObjectGroup and sets it to be the current IObjectGrouping.
protected  void purgeGroupingsToSet()
          Removed IObject:s from the IObjectGrouping:s that are not in the IObjectSet.
 void purgeSetToCurrentGrouping()
          Removes all IObjects that's not in the current IObjectGrouping from the set and all its IObjectGroupings.
 void remove(IObject io)
          Removes a IObject.
 void removeAll()
           
 void removeGrouping(IObjectGrouping cog)
          Removes an IObjectGrouping.
 boolean setGrouping(IObjectGrouping cog)
          Sets the current IObjectGrouping.
 void sortInCurrentVectorOrderWithInvertedOrderNumberAsValue()
           
 
Methods inherited from class infomat.vectorspace.IObjectGroup
addAll, addAll, contains, containsPrecisely, getIObjectAt, getIObjectOrderIndex, getIVector, getName, getObjectOrderValueMap, getOrdered, getSortedObjectOrderValueVector, notIn, numberOfIObjects, numberOfSharedIObjects, randomOrder, remove, removeObjectsNotIn, setIVector, setName, sortInOrderValueOrder, subGroup
 
Methods inherited from class infomat.vectorspace.IObject
getAmbiguous, getAmbiguousString, getID, getKind, getLargestCommonLocation, getLocation, getString, setAmbiguous, setString, stringCompareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idIterator

private static int idIterator

groupings

private java.util.Vector<IObjectGrouping> groupings

nameGroupingMap

private java.util.HashMap<java.lang.String,IObjectGrouping> nameGroupingMap

currentGrouping

private IObjectGrouping currentGrouping

idIObjectMap

private java.util.HashMap<java.lang.Integer,IObject> idIObjectMap

stringAmbiguousIObjectsMap

private java.util.HashMap<java.lang.String,java.util.HashSet<IObject>> stringAmbiguousIObjectsMap
Constructor Detail

IObjectSet

public IObjectSet(java.lang.String name)

IObjectSet

public IObjectSet(IObjectSet ios)
Copy constructor. Makes new instances of everything, but the IObject:s, which are the same. Gives the new IObjectSet the same name, but a different id.

Method Detail

add

public void add(IObject io)
Adds a new IObject. OBS. This is not reflected in any IObjectGrouping:s that already exit.

Overrides:
add in class IObjectGroup

add

public void add(IObject io,
                float orderValue)
Description copied from class: IObjectGroup
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 IObjectGroup.sortInOrderValueOrder().

Overrides:
add in class IObjectGroup

remove

public void remove(IObject io)
Removes a IObject. It is removed from all IObjectGrouping:s as well. Compare to #add where IObjects are not added to existing IObjectGrouping:s.

Overrides:
remove in class IObjectGroup

removeAll

public void removeAll()
Overrides:
removeAll in class IObjectGroup

sortInCurrentVectorOrderWithInvertedOrderNumberAsValue

public void sortInCurrentVectorOrderWithInvertedOrderNumberAsValue()
Overrides:
sortInCurrentVectorOrderWithInvertedOrderNumberAsValue in class IObjectGroup

addGrouping

public boolean addGrouping(IObjectGrouping cog)
Adds an IObjectGrouping. Returns false if the name for this new grouping is already taken.


removeGrouping

public void removeGrouping(IObjectGrouping cog)
Removes an IObjectGrouping.


purgeSetToCurrentGrouping

public void purgeSetToCurrentGrouping()
Removes all IObjects that's not in the current IObjectGrouping from the set and all its IObjectGroupings.


purgeGroupingsToSet

protected void purgeGroupingsToSet()
Removed IObject:s from the IObjectGrouping:s that are not in the IObjectSet. Used by IMatrixCellFilter.

See Also:
IMatrixFilter, IObjectGrouping#prugeGroupingToSet()

setGrouping

public boolean setGrouping(IObjectGrouping cog)
Sets the current IObjectGrouping. Returns false if the IObjectGrouping has a conflict as in #addGrouping().


getCurrentGrouping

public IObjectGrouping getCurrentGrouping()
Returns the current IObjectGrouping.


getGroupings

public java.util.Vector<IObjectGrouping> getGroupings()
Returns all IObjectGrouping:s of this IObjectSet.


getGroupingWithName

public IObjectGrouping getGroupingWithName(java.lang.String name)
Returns the IObjectGrouping with the name given.


containsIObjectGrouping

public boolean containsIObjectGrouping(IObjectGrouping ioging)
Returns true if the IObjectGrouping orders this IObjectSet.


containsIObjectGroup

public boolean containsIObjectGroup(IObjectGroup iog)
Returns true if any of the IObjectGrouping:s that order this IObjectSet contains the IObjectGroup.


makeStartGrouping

public IObjectGrouping makeStartGrouping()
Makes a IObjectGrouping consisting of one IObjectGroup and sets it to be the current IObjectGrouping. Used as a first IObjectGrouping as many function needs one to work.


getIObjectWithId

public IObject getIObjectWithId(int i)
Returns the IObject with the given id.


getLargestStartOfLocation

public java.lang.String getLargestStartOfLocation()