WordFactory
edu.jas.poly

Class WordFactory

    • Field Detail

      • ONE

        public final Word ONE
        The empty word for this monoid.
      • translation

        public final String[] translation
        The translation array of Strings.
    • Constructor Detail

      • WordFactory

        public WordFactory()
        Constructor for WordFactory.
      • WordFactory

        public WordFactory(String s)
        Constructor for WordFactory.
        Parameters:
        s - String of single letters for alphabet
      • WordFactory

        public WordFactory(String[] S)
        Constructor for WordFactory.
        Parameters:
        S - String array for alphabet
    • Method Detail

      • isCommutative

        public boolean isCommutative()
        Query if this monoid is commutative.
        Specified by:
        isCommutative in interface MonoidFactory<Word>
        Returns:
        true if this monoid is commutative, else false.
      • isAssociative

        public boolean isAssociative()
        Query if this monoid is associative.
        Specified by:
        isAssociative in interface MonoidFactory<Word>
        Returns:
        true if this monoid is associative, else false.
      • getONE

        public Word getONE()
        Get the one element, the empty word.
        Specified by:
        getONE in interface MonoidFactory<Word>
        Returns:
        1 as Word.
      • copy

        public Word copy(Word w)
        Copy word.
        Specified by:
        copy in interface ElemFactory<Word>
        Parameters:
        w - word to copy.
        Returns:
        copy of w.
      • length

        public int length()
        Get the alphabet length.
        Returns:
        alphabet.length.
      • getVal

        public char getVal(int i)
        Get the alphabet letter at position i.
        Parameters:
        i - position.
        Returns:
        val[i].
      • generators

        public List<Word> generators()
        Get a list of the generating elements.
        Specified by:
        generators in interface ElemFactory<Word>
        Returns:
        list of generators for the algebraic structure.
      • fromInteger

        public Word fromInteger(long a)
        Get the Element for a.
        Specified by:
        fromInteger in interface ElemFactory<Word>
        Parameters:
        a - long
        Returns:
        element corresponding to a.
      • fromInteger

        public Word fromInteger(BigInteger a)
        Get the Element for a.
        Specified by:
        fromInteger in interface ElemFactory<Word>
        Parameters:
        a - java.math.BigInteger.
        Returns:
        element corresponding to a.
      • valueOf

        public Word valueOf(ExpVector e)
        Get the Element for an ExpVector.
        Parameters:
        e - ExpVector.
        Returns:
        element corresponding to e.
      • random

        public Word random(int n)
        Generate a random Element with size less equal to n.
        Specified by:
        random in interface ElemFactory<Word>
        Parameters:
        n -
        Returns:
        a random element.
      • random

        public Word random(int n,          Random random)
        Generate a random Element with size less equal to n.
        Specified by:
        random in interface ElemFactory<Word>
        Parameters:
        n -
        random - is a source for random bits.
        Returns:
        a random element.
      • parse

        public Word parse(String s)
        Parse from String.
        Specified by:
        parse in interface ElemFactory<Word>
        Parameters:
        s - String.
        Returns:
        a Element corresponding to s.
      • parse

        public Word parse(Reader r)
        Parse from Reader. White space is delimiter for word.
        Specified by:
        parse in interface ElemFactory<Word>
        Parameters:
        r - Reader.
        Returns:
        the next Element found on r.
      • getDescendComparator

        public WordFactory.WordComparator getDescendComparator()
        Get the descending order comparator. Sorts the highest terms first.
        Returns:
        horder.
      • getAscendComparator

        public WordFactory.WordComparator getAscendComparator()
        Get the ascending order comparator. Sorts the lowest terms first.
        Returns:
        lorder.
      • cleanSpace

        public static String cleanSpace(String s)
        Prepare parse from String.
        Parameters:
        s - String.
        Returns:
        a Element corresponding to s.
      • clean

        public static String clean(String s)
        Prepare parse from String.
        Parameters:
        s - String.
        Returns:
        a Element corresponding to s.
      • cleanAll

        public static String[] cleanAll(String[] v)
        Prepare parse from String array.
        Parameters:
        v - String array.
        Returns:
        an array of cleaned strings.
      • concat

        public static String concat(String[] v)
        Concat variable names.
        Parameters:
        v - an array of strings.
        Returns:
        the concatination of the strings in v.
      • trimAll

        public static String[] trimAll(String[] v)
        Trim all variable names.
        Parameters:
        v - an array of strings.
        Returns:
        an array of strings with all elements trimmed.
      • indexOf

        public static int indexOf(String[] v,          String s)
        IndexOf for String array.
        Parameters:
        v - an array of strings.
        s - string.
        Returns:
        index of s in v, or -1 if s is not contained in v.
      • isSingleLetters

        public static boolean isSingleLetters(String[] v)
        Test if all variables are single letters.
        Parameters:
        v - an array of strings.
        Returns:
        true, if all variables have length 1, else false.
      • translate

        public String translate(String[] v)
        Translate variable names.
        Parameters:
        v - an array of strings.
        Returns:
        the translated string of v with respect to t.
      • transVar

        public String transVar(char c)
        Translate variable name.
        Parameters:
        c - internal char.
        Returns:
        the extenal translated string.

SCaVis 2.0 © jWork.ORG