mathcomp.la
Class CollectionIndex

java.lang.Object
  extended by mathcomp.la.CollectionIndex
All Implemented Interfaces:
Index

public class CollectionIndex
extends java.lang.Object
implements Index

An Index using a java.util.Collection. This may be e.g. a java.util.Set or a java.util.List. CollectionIndex fiddles about the issue with comparations.

Author:
pht

Constructor Summary
CollectionIndex()
           
CollectionIndex(java.util.Collection coll)
           
 
Method Summary
 Matrix createMatrix()
          Creates a new MapMatrix based on this index.
 Vector createVector()
          Creates a new MapVector based on this index.
 java.util.Collection getColl()
           
 java.util.Iterator iterator()
          This returns a enumeration of the index.
 void setColl(java.util.Collection coll)
           
 int size()
          This returns the cardinality of the index.
 java.util.List toList()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionIndex

public CollectionIndex()

CollectionIndex

public CollectionIndex(java.util.Collection coll)
Method Detail

size

public int size()
Description copied from interface: Index
This returns the cardinality of the index.

Specified by:
size in interface Index
Returns:
the cardinality of the index, a number >= 0

iterator

public java.util.Iterator iterator()
Description copied from interface: Index
This returns a enumeration of the index.

Specified by:
iterator in interface Index
Returns:
enumeration of the index

getColl

public java.util.Collection getColl()
Returns:

setColl

public void setColl(java.util.Collection coll)
Parameters:
list -

toList

public java.util.List toList()
Specified by:
toList in interface Index
Returns:
a java.util.List containing the index.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createVector

public Vector createVector()
Creates a new MapVector based on this index. If the collection is sorted then the map will be a TreeMap.

Specified by:
createVector in interface Index
Returns:
a new Vector indexed by this Index
See Also:
Index.createVector()

createMatrix

public Matrix createMatrix()
Creates a new MapMatrix based on this index. If the collection is sorted then the map will be a TreeMap.

Specified by:
createMatrix in interface Index
Returns:
a new Matrix indexed by this Index
See Also:
Index.createMatrix()