Package flanagan.circuits

Examples of flanagan.circuits.Phasor


        // Reads a Phasor from the dialog box
        // No prompt message, No default option
        public static final synchronized Phasor readPhasor(){
                String line="";
                String mess="Input type: Phasor ('mag'<'phase'deg or 'mag'<'phase'rad)";
                Phasor ph = new Phasor();
                boolean finish = false;
                System.out.flush();

                while(!finish){
                        line = JOptionPane.showInputDialog(mess);
View Full Code Here


        // e.g. 1.23<34.1deg, -0.67<-56.7, 6.8e2<-0.22rad
        public final synchronized Phasor readPhasor(){

                this.inputType = true;
                String word="";
                Phasor ph = null;

                if(!this.testFullLineT) this.enterLine();
                word = nextWord();

                if(!eof)ph = Phasor.parsePhasor(word.trim());
View Full Code Here

    // Complex -> Phasor
    public static Phasor convert_Complex_to_Phasor(Complex xx){
        double mag = xx.abs();
        double phase = xx.argDeg();
        return new Phasor(mag, phase);
    }
View Full Code Here

                    am.summ.add(bi);
                    break;
            case 14:  Complex cc = (Complex)summ.get(0);
                    am.summ.add(cc);
                    break;
            case 15:  Phasor pp = (Phasor)summ.get(0);
                    am.summ.add(pp);
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
            }
        }

        am.productt = new ArrayList<Object>();
        if(this.productt.size()!=0){
            switch(this.type){
            case 0:
            case 1:
            case 2:
            case 3:
            case 18: double dd = ((Double)productt.get(0)).doubleValue();
                    am.productt.add(new Double(dd));
                    break;
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 16:
            case 17: if(this.sumlongToDouble){
                        double dd2 = ((Double)productt.get(0)).doubleValue();
                        am.productt.add(new Double(dd2));
                    }
                    else{
                        long ll = ((Long)productt.get(0)).longValue();
                        am.productt.add(new Long(ll));
                    }
                    break;
            case 12: BigDecimal bd = (BigDecimal)productt.get(0);
                    am.productt.add(bd);
                    break;
            case 13:  BigInteger bi = (BigInteger)productt.get(0);
                    am.productt.add(bi);
                    break;
            case 14:  Complex cc = (Complex)productt.get(0);
                    am.productt.add(cc);
                    break;
            case 15:  Phasor pp = (Phasor)productt.get(0);
                    am.productt.add(pp);
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
            }
        }
View Full Code Here

            case 14: Complex[] cc = this.getArray_as_Complex();
                    for(int i=0; i<this.length; i++)am.array.add(cc[i].minus(arrayBD[i].doubleValue()));
                    am.type = this.type;
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    for(int i=0; i<this.length; i++)am.array.add(pp[i].minus(new Phasor(arrayBD[i].doubleValue())));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a BigDecimal cannot be subtracted from a char");
            case 17: throw new IllegalArgumentException("a BigDecimal cannot be subtracted from a Character");
            case 18: throw new IllegalArgumentException("a BigDecimalcannot be subtracted from a String");
View Full Code Here

            case 14: Complex[] cc = this.getArray_as_Complex();
                    for(int i=0; i<this.length; i++)am.array.add(cc[i].minus(Conv.convert_BigInteger_to_double(constant)));
                    am.type = this.type;
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    for(int i=0; i<this.length; i++)am.array.add(pp[i].minus(new Phasor(Conv.convert_BigInteger_to_double(constant))));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a BigInteger cannot be subtracted from a char");
            case 17: throw new IllegalArgumentException("a BigInteger cannot be subtracted from a Character");
            case 18: throw new IllegalArgumentException("a BigInteger cannot be subtracted from a String");
View Full Code Here

            case 14: Complex[] cc = this.getArray_as_Complex();
                    for(int i=0; i<this.length; i++)am.array.add(cc[i].minus(Conv.convert_BigInteger_to_double(arrayBI[i])));
                    am.type = this.type;
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    for(int i=0; i<this.length; i++)am.array.add(pp[i].minus(new Phasor(Conv.convert_BigInteger_to_double(arrayBI[i]))));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a BigInteger cannot be subtracted from a char");
            case 17: throw new IllegalArgumentException("a BigInteger cannot be subtracted from a Character");
            case 18: throw new IllegalArgumentException("a BigInteger cannot be subtracted from a String");
View Full Code Here

                    am.type = 13;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).times((double)constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).times(new Phasor((double)constant)));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a long cannot be multiplied by a char");
            case 17: throw new IllegalArgumentException("a long cannot be multiplied by a Character");
            case 18: throw new IllegalArgumentException("a long cannot be multiplied by a String");
View Full Code Here

                    am.type = 13;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).times((double)constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).times(new Phasor((double)constant)));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("an int cannot be multiplied by a char");
            case 17: throw new IllegalArgumentException("an int cannot be multiplied by a Character");
            case 18: throw new IllegalArgumentException("an int cannot be multiplied by a String");
View Full Code Here

                    am.type = 13;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).times((double)constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).times(new Phasor((double)constant)));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a short cannot be multiplied by a char");
            case 17: throw new IllegalArgumentException("a short cannot be multiplied by a Character");
            case 18: throw new IllegalArgumentException("a short cannot be multiplied by a String");
View Full Code Here

TOP

Related Classes of flanagan.circuits.Phasor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.