Changeset 3739


Ignore:
Timestamp:
Apr 18, 2008, 3:28:18 PM (13 years ago)
Author:
yura
Message:
  • Refal object logical structure.
Location:
to-imperative/trunk/java/java/org/refal/plus
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/java/org/refal/plus/Expr.java

    r3729 r3739  
    360360     * Returns the contents of this expr.
    361361     */
    362     public Comparable<?>[] toArray () {
     362    public Object[] toArray () {
    363363        Comparable<?>[] arr = new Comparable[length];
    364364        arrayCopy(terms, start, arr, 0, length);
  • to-imperative/trunk/java/java/org/refal/plus/Result.java

    r3729 r3739  
    2424    }
    2525
    26     // public void assign (Comparable<?>[] arr) {
    27     // expr = Expr.fromComparableArray(arr);
    28     // }
    29 
    3026    public Expr getExpr () {
    3127        return expr;
     
    3632        return expr != null ? expr.toString() : null;
    3733    }
    38 
    39     public Comparable<?>[] toArray () {
    40         return expr != null ? expr.toArray() : null;
    41     }
    4234}
  • to-imperative/trunk/java/java/org/refal/plus/objects/String.java

    r3725 r3739  
    1919    }
    2020
     21    public String subString (int s, int e) {
     22        String vector = new String();
     23        vector.addAll(subList(s, e));
     24        return vector;
     25    }
     26
    2127    public Expr toExpr () {
    2228        Expr.Concatenator concat = Expr.getConcatenator(size());
     
    2632    }
    2733   
    28     public String subString (int s, int e) {
    29         String vector = new String();
    30         vector.addAll(subList(s, e));
    31         return vector;
    32     }
    33 
    3434    @Override
    3535    public java.lang.String toString () {
  • to-imperative/trunk/java/java/org/refal/plus/objects/Table.java

    r3721 r3739  
    3030    }
    3131
    32     public Expr toExpr () {
    33         Expr.Concatenator concat = Expr.getConcatenator(size());
    34         for (Map.Entry<Expr, Expr> pair : entrySet())
    35             concat.toRight((Comparable<?>) Expr.concat((Comparable<?>) pair.getKey(), (Comparable<?>) pair.getValue()));
    36         return concat.yield();
    37     }
    38    
    3932    public Expr getKeys () {
    4033        Expr.Concatenator concat = Expr.getConcatenator(size());
     
    5144    }
    5245
    53     @Override
    54     public java.lang.String toString () {
    55         return toExpr().toString();
     46    public Expr toExpr () {
     47        Expr.Concatenator concat = Expr.getConcatenator(size());
     48        for (Map.Entry<Expr, Expr> pair : entrySet())
     49            concat.toRight((Comparable<?>) Expr.concat((Comparable<?>) pair.getKey(), (Comparable<?>) pair.getValue()));
     50        return concat.yield();
    5651    }
    5752
     
    6358        return arr;
    6459    }
     60
     61    @Override
     62    public java.lang.String toString () {
     63        return toExpr().toString();
     64    }
    6565}
  • to-imperative/trunk/java/java/org/refal/plus/objects/Vector.java

    r3725 r3739  
    1919    }
    2020
     21    public Vector subVector (int s, int e) {
     22        Vector vector = new Vector();
     23        vector.addAll(subList(s, e));
     24        return vector;
     25    }
     26
    2127    public Expr toExpr () {
    2228        Expr.Concatenator concat = Expr.getConcatenator(size());
     
    2430            concat.toRight((Comparable<?>) expr);
    2531        return concat.yield();
    26     }
    27    
    28     public Vector subVector (int s, int e) {
    29         Vector vector = new Vector();
    30         vector.addAll(subList(s, e));
    31         return vector;
    3232    }
    3333
Note: See TracChangeset for help on using the changeset viewer.