rt/emul/compact/src/main/java/java/lang/System.java
author Anton Epple <toni.epple@eppleton.de>
Sun, 08 Sep 2013 11:22:51 +0200
branchcanvas
changeset 1268 7937df26a5a7
parent 1262 bbc756ef9a73
parent 1260 fe3567c7b522
child 1269 8dce385fd361
permissions -rw-r--r--
merging latest changes from default
jaroslav@1260
     1
/**
jaroslav@1260
     2
 * Back 2 Browser Bytecode Translator
jaroslav@1260
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1260
     4
 *
jaroslav@1260
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1260
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1260
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1260
     8
 *
jaroslav@1260
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1260
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1260
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1260
    12
 * GNU General Public License for more details.
jaroslav@1260
    13
 *
jaroslav@1260
    14
 * You should have received a copy of the GNU General Public License
jaroslav@1260
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1260
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@1260
    17
 */
jaroslav@1260
    18
package java.lang;
jaroslav@1260
    19
jaroslav@1260
    20
/** Poor man's re-implementation of most important System methods.
jaroslav@1260
    21
 *
jaroslav@1260
    22
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@1260
    23
 */
jaroslav@1260
    24
public class System {
jaroslav@1260
    25
    private System() {
jaroslav@1260
    26
    }
jaroslav@1260
    27
    
jaroslav@1260
    28
    public static void arraycopy(Object value, int srcBegin, Object dst, int dstBegin, int count) {
jaroslav@1260
    29
        org.apidesign.bck2brwsr.emul.lang.System.arraycopy(value, srcBegin, dst, dstBegin, count);
jaroslav@1260
    30
    }
jaroslav@1260
    31
    
jaroslav@1260
    32
    public static long currentTimeMillis() {
jaroslav@1260
    33
        return org.apidesign.bck2brwsr.emul.lang.System.currentTimeMillis();
jaroslav@1260
    34
    }
jaroslav@1260
    35
    
jaroslav@1260
    36
    public static int identityHashCode(Object obj) {
jaroslav@1260
    37
        return obj.defaultHashCode();
jaroslav@1260
    38
    }
jaroslav@1260
    39
jaroslav@1260
    40
    public static String getProperty(String name) {
jaroslav@1260
    41
        return null;
jaroslav@1260
    42
    }
jaroslav@1260
    43
    
jaroslav@1260
    44
    public static String getProperty(String key, String def) {
jaroslav@1260
    45
        return def;
jaroslav@1260
    46
    }
jaroslav@1260
    47
    
jaroslav@1260
    48
    /**
jaroslav@1260
    49
     * Returns the system-dependent line separator string.  It always
jaroslav@1260
    50
     * returns the same value - the initial value of the {@linkplain
jaroslav@1260
    51
     * #getProperty(String) system property} {@code line.separator}.
jaroslav@1260
    52
     *
jaroslav@1260
    53
     * <p>On UNIX systems, it returns {@code "\n"}; on Microsoft
jaroslav@1260
    54
     * Windows systems it returns {@code "\r\n"}.
jaroslav@1260
    55
     */
jaroslav@1260
    56
    public static String lineSeparator() {
jaroslav@1260
    57
        return "\n";
jaroslav@1260
    58
    }
jaroslav@1260
    59
}