org.uacalc.alg
Class BasicAlgebra

java.lang.Object
  extended by org.uacalc.alg.GeneralAlgebra
      extended by org.uacalc.alg.BasicAlgebra
All Implemented Interfaces:
Algebra, SmallAlgebra

public class BasicAlgebra
extends GeneralAlgebra
implements SmallAlgebra

This class represents SmallAlgebra's. Such algebras have a map from {0, ..., n-1} and the elements of the algebra. The operations are done on the ints and converted back the elements.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.uacalc.alg.SmallAlgebra
SmallAlgebra.AlgebraType
 
Field Summary
protected  java.util.List universeList
          Ordered list of the universe.
protected  java.util.Map universeOrder
          A map from the elements to their order in the universe list.
 
Fields inherited from class org.uacalc.alg.GeneralAlgebra
con, description, monitor, name, operations, operationsMap, similarityType, size, sub, universe
 
Fields inherited from interface org.uacalc.alg.Algebra
CARDINALITY_COUNTABLE, CARDINALITY_COUNTABLY_INFINITE, CARDINALITY_FINITE, CARDINALITY_INFINITE, CARDINALITY_UNKNOWN
 
Constructor Summary
BasicAlgebra(java.lang.String name, int s, java.util.List<Operation> operations)
          If a universe is not given, use Integers.
BasicAlgebra(java.lang.String name, java.util.List univ, java.util.List<Operation> operations)
          This constructs a SmallAlgebra from a ordered list of elements.
 
Method Summary
 SmallAlgebra.AlgebraType algebraType()
          The type of algebra this is, like a quotient algebra.
 CongruenceLattice con()
          The congurence lattice.
 void convertToDefaultValueOps()
          This is used in the UI.
 int elementIndex(java.lang.Object obj)
          This method will return k if elem is the kth element; otherwise -1.
 java.lang.Object getElement(int index)
          returns the kth element.
 java.util.List getUniverseList()
          The universe as a List such getElement(k) will equal the kth element of the List.
 java.util.Map getUniverseOrder()
          A map that can be used for elementIndex(a).
 boolean intUniverse()
          If this is true, there is no real universe; we just use Integers.
static void main(java.lang.String[] args)
           
 void resetConAndSub()
          This does nothing but is overwritten for BasicAlgebra's.
 void setUniverseList(java.util.List lst)
           
 void setUniverseOrder(java.util.Map ord)
           
 SubalgebraLattice sub()
          The subalgebra lattice.
 
Methods inherited from class org.uacalc.alg.GeneralAlgebra
cardinality, constantOperations, getDescription, getMonitor, getName, getOperation, getOperationsMap, inputSize, isIdempotent, isSimilarTo, isTotal, isUnary, iterator, makeOperationTables, monitoring, operations, parent, parents, setDescription, setMonitor, setName, setOperations, setUniverse, similarityType, universe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.uacalc.alg.SmallAlgebra
parent, parents
 
Methods inherited from interface org.uacalc.alg.Algebra
cardinality, constantOperations, getDescription, getMonitor, getName, getOperation, getOperationsMap, inputSize, isIdempotent, isSimilarTo, isTotal, isUnary, iterator, makeOperationTables, monitoring, operations, setDescription, setMonitor, setName, similarityType, universe
 

Field Detail

universeList

protected java.util.List universeList
Ordered list of the universe.


universeOrder

protected java.util.Map universeOrder
A map from the elements to their order in the universe list.

Constructor Detail

BasicAlgebra

public BasicAlgebra(java.lang.String name,
                    int s,
                    java.util.List<Operation> operations)
If a universe is not given, use Integers.


BasicAlgebra

public BasicAlgebra(java.lang.String name,
                    java.util.List univ,
                    java.util.List<Operation> operations)
This constructs a SmallAlgebra from a ordered list of elements. The operations need to have intValueAt(int[]) implemented.

Method Detail

getUniverseList

public java.util.List getUniverseList()
Description copied from interface: SmallAlgebra
The universe as a List such getElement(k) will equal the kth element of the List. It is allowed to be null.

Specified by:
getUniverseList in interface SmallAlgebra

setUniverseList

public void setUniverseList(java.util.List lst)

getUniverseOrder

public java.util.Map getUniverseOrder()
Description copied from interface: SmallAlgebra
A map that can be used for elementIndex(a). It is allowed to be null.

Specified by:
getUniverseOrder in interface SmallAlgebra

setUniverseOrder

public void setUniverseOrder(java.util.Map ord)

intUniverse

public boolean intUniverse()
If this is true, there is no real universe; we just use Integers.


elementIndex

public int elementIndex(java.lang.Object obj)
Description copied from interface: SmallAlgebra
This method will return k if elem is the kth element; otherwise -1. (Should we have it throw an error instead?)

Specified by:
elementIndex in interface SmallAlgebra

getElement

public java.lang.Object getElement(int index)
Description copied from interface: SmallAlgebra
returns the kth element.

Specified by:
getElement in interface SmallAlgebra

con

public CongruenceLattice con()
Description copied from interface: SmallAlgebra
The congurence lattice.

Specified by:
con in interface SmallAlgebra
Overrides:
con in class GeneralAlgebra

sub

public SubalgebraLattice sub()
Description copied from interface: SmallAlgebra
The subalgebra lattice.

Specified by:
sub in interface SmallAlgebra
Overrides:
sub in class GeneralAlgebra

resetConAndSub

public void resetConAndSub()
Description copied from class: GeneralAlgebra
This does nothing but is overwritten for BasicAlgebra's.

Specified by:
resetConAndSub in interface SmallAlgebra
Overrides:
resetConAndSub in class GeneralAlgebra

convertToDefaultValueOps

public void convertToDefaultValueOps()
Description copied from interface: SmallAlgebra
This is used in the UI. Only valid for BASIC algebras.

Specified by:
convertToDefaultValueOps in interface SmallAlgebra

algebraType

public SmallAlgebra.AlgebraType algebraType()
Description copied from interface: SmallAlgebra
The type of algebra this is, like a quotient algebra.

Specified by:
algebraType in interface SmallAlgebra
Returns:

main

public static void main(java.lang.String[] args)


Copyright 2003 Ralph Freese. All Rights Reserved.