001 /*
002 * jDTAUS - DTAUS fileformat.
003 * Copyright (c) 2005 Christian Schulte <cs@schulte.it>
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either
008 * version 2.1 of the License, or any later version.
009 *
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013 * Lesser General Public License for more details.
014 *
015 * You should have received a copy of the GNU Lesser General Public
016 * License along with this library; if not, write to the Free Software
017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
018 *
019 */
020 package org.jdtaus.core.lang;
021
022 /**
023 * Implementation runtime.
024 * <p>The implementation runtime allows applications to interface with the
025 * environment implementations are running in.</p>
026 * <p>Example: Accessing the runtime of all jDTAUS Core SPI compliant
027 * implementations in the system<br/><pre>
028 * Runtime runtime =
029 * (Runtime) ContainerFactory.getContainer().
030 * getImplementation(Runtime.class, "jDTAUS Core SPI");
031 * </pre></p>
032 *
033 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
034 * @version $Id: Runtime.java 1914 2007-03-01 02:20:44Z schulte2005 $
035 */
036 public interface Runtime
037 {
038
039 //--Runtime-----------------------------------------------------------------
040
041 /**
042 * Computes the amount of allocated memory in percent.
043 *
044 * @return percent of memory currently allocated
045 * (so that {@code 100 - getAllocatedPercent()}% of memory is currently
046 * available to allocation).
047 */
048 long getAllocatedPercent();
049
050 /**
051 * Computes the maximum number of byte values currently being available to
052 * allocation.
053 *
054 * @return number of byte values currently available to allocation.
055 */
056 long getAvailableBytes();
057
058 /**
059 * Computes the maximum number of short values currently being available to
060 * allocation.
061 *
062 * @return number of short values currently available to allocation.
063 */
064 long getAvailableShorts();
065
066 /**
067 * Computes the maximum number of integer values currently being available
068 * to allocation.
069 *
070 * @return number of integer values currently available to allocation.
071 */
072 long getAvailableIntegers();
073
074 /**
075 * Computes the maximum number of long values currently being available
076 * to allocation.
077 *
078 * @return number of long values currently available to allocation.
079 */
080 long getAvailableLongs();
081
082 /**
083 * Computes the maximum number of char values currently being available
084 * to allocation.
085 *
086 * @return number of char values currently available to allocation.
087 */
088 long getAvailableChars();
089
090 /**
091 * Computes the maximum number of float values currently being available
092 * to allocation.
093 *
094 * @return number of float values currently available to allocation.
095 */
096 long getAvailableFloats();
097
098 /**
099 * Computes the maximum number of double values currently being available
100 * to allocation.
101 *
102 * @return number of double values currently available to allocation.
103 */
104 long getAvailableDoubles();
105
106 /**
107 * Computes the maximum number of boolean values currently being available
108 * to allocation.
109 *
110 * @return number of boolean values currently available to allocation.
111 */
112 long getAvailableBooleans();
113
114 //-----------------------------------------------------------------Runtime--
115
116 }