Check-in [5133c45caf]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Have ConfigEntry and ConfigReader just be iteration over that, ConfigEntry has all the parsing stuff.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip-springcoat-bringup
Files: files | file ages | folders
SHA1: 5133c45cafeaec92d5a38b4347113a11ba72366b
User & Date: stephanie.gawroriski 2020-05-13 00:01:27
Context
2020-05-13
01:29
Add configuration lookups and otherwise, change the locale to be a bit different in how it works. check-in: dc7c4033d2 user: stephanie.gawroriski tags: wip-springcoat-bringup
00:01
Have ConfigEntry and ConfigReader just be iteration over that, ConfigEntry has all the parsing stuff. check-in: 5133c45caf user: stephanie.gawroriski tags: wip-springcoat-bringup
2020-05-12
19:52
Add base code to push classpaths from the ROM to processes. check-in: 5770b6db48 user: stephanie.gawroriski tags: wip-springcoat-bringup
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/cldc-compact/src/main/java/cc/squirreljme/jvm/boot/ConfigEntry.java.

5
6
7
8
9
10
11


12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


















28
29
30
31
32
33
34
35
36






















37
38
39
40
41
42
43
44
45
46












47
48
49
50
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.boot;



import cc.squirreljme.runtime.cldc.debug.Debugging;


/**
 * Represents a configuration entry.
 *
 * @since 2020/04/03
 */
public final class ConfigEntry
{
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
	public int hashCode()
	{


















		throw Debugging.todo();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
	public boolean equals(Object __o)






















	{
		throw Debugging.todo();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
	public String toString()












	{
		throw Debugging.todo();
	}
}







>
>

>













|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










>
>
>
>
>
>
>
>
>
>
>
>




5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.boot;

import cc.squirreljme.jvm.ConfigRomKey;
import cc.squirreljme.jvm.ConfigRomType;
import cc.squirreljme.runtime.cldc.debug.Debugging;
import java.util.NoSuchElementException;

/**
 * Represents a configuration entry.
 *
 * @since 2020/04/03
 */
public final class ConfigEntry
{
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
	public boolean equals(Object __o)
	{
		throw Debugging.todo();
	}
	
	/**
	 * Gets the string array from this configuration entry.
	 *
	 * @return The string array.
	 * @throws IllegalArgumentException If this entry does not refer to a value
	 * that is compatible with a string array.
	 * @since 2020/05/12
	 */
	public final String[] getStrings()
		throws IllegalArgumentException
	{
		// {@squirreljme.error ZZ4B Entry is not compatible with UTF list.}
		if (this.type() != ConfigRomType.UTF_LIST)
			throw new IllegalArgumentException("ZZ4B");
		
		throw Debugging.todo();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
	public int hashCode()
	{
		throw Debugging.todo();
	}
	
	/**
	 * Returns the key for this type.
	 *
	 * @return The key that is used for this entry.
	 * @since 2020/05/12
	 */
	public final int key()
	{
		throw Debugging.todo();
	}
	
	/**
	 * Returns the raw value of this configuration entry.
	 *
	 * @return The raw value.
	 * @since 2020/05/03
	 */
	public final long rawValue()
	{
		throw Debugging.todo();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
	public String toString()
	{
		throw Debugging.todo();
	}
	
	/**
	 * Returns the type that this entry is.
	 *
	 * @return The {@link ConfigRomType}.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/12
	 */
	public final int type()
	{
		throw Debugging.todo();
	}
}

Changes to modules/cldc-compact/src/main/java/cc/squirreljme/jvm/boot/ConfigReader.java.

40
41
42
43
44
45
46





















47
48
49
50
51
52
53
..
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101





102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
		throws NullPointerException
	{
		if (__mem == null)
			throw new NullPointerException("NARG");
		
		this.memory = __mem;
	}





















	
	/**
	 * Gets the string array from a key.
	 *
	 * @param __key The {@link ConfigRomKey} to obtain.
	 * @return The string array.
	 * @throws IllegalArgumentException If the key does not refer to a value
................................................................................
	 * that is compatible with a string array.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/12
	 */
	public final String[] getStrings(int __key)
		throws IllegalArgumentException, NoSuchElementException
	{
		// {@squirreljme.error ZZ4B Key is not UTF list type. (The key)}
		if (this.type(__key) != ConfigRomType.UTF_LIST)
			throw new IllegalArgumentException("ZZ4B " + __key);
		
		throw Debugging.todo();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
................................................................................
	 * @return The raw value.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/03
	 */
	public final long rawValue(int __key)
		throws NoSuchElementException
	{
		Assembly.breakpoint();
		throw Debugging.todo();
	}
	
	/**
	 * Returns the number of configuration items.
	 *
	 * @return The number of configuration items.
	 * @since 2002/04/03
	 */
	public final int size()
	{
		throw Debugging.todo();





	}
	
	/**
	 * Returns the type that the key is.
	 *
	 * @param __key The key to use.
	 * @return The {@link ConfigRomType}.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/03
	 */
	public final int type(int __key)
		throws NoSuchElementException
	{
		Assembly.breakpoint();
		throw Debugging.todo();
	}
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
<
<
<
<







 







|
<










|
>
>
>
>
>













|
<



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
..
75
76
77
78
79
80
81
82




83
84
85
86
87
88
89
..
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137
138
139
		throws NullPointerException
	{
		if (__mem == null)
			throw new NullPointerException("NARG");
		
		this.memory = __mem;
	}
	
	/**
	 * Gets the configuration entry by the given key.
	 *
	 * @param __key The key to lookup.
	 * @return The config entry for the given key.
	 * @throws NoSuchElementException If the key is not found in the
	 * configuration.
	 * @since 2020/05/12
	 */
	public final ConfigEntry getByKey(int __key)
		throws NoSuchElementException
	{
		for (ConfigEntry entry : this)
			if (entry.key() == __key)
				return entry;
		
		// {@squirreljme.error ZZ4D No configuration entry exists for
		// the given key. (Key type)}
		throw new NoSuchElementException("ZZ4D " + __key);
	}
	
	/**
	 * Gets the string array from a key.
	 *
	 * @param __key The {@link ConfigRomKey} to obtain.
	 * @return The string array.
	 * @throws IllegalArgumentException If the key does not refer to a value
................................................................................
	 * that is compatible with a string array.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/12
	 */
	public final String[] getStrings(int __key)
		throws IllegalArgumentException, NoSuchElementException
	{
		return this.getByKey(__key).getStrings();




	}
	
	/**
	 * {@inheritDoc}
	 * @since 2020/04/03
	 */
	@Override
................................................................................
	 * @return The raw value.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/03
	 */
	public final long rawValue(int __key)
		throws NoSuchElementException
	{
		return this.getByKey(__key).rawValue();

	}
	
	/**
	 * Returns the number of configuration items.
	 *
	 * @return The number of configuration items.
	 * @since 2002/04/03
	 */
	public final int size()
	{
		int count = 0;
		
		for (ConfigEntry ignored : this)
			count++;
		
		return count;
	}
	
	/**
	 * Returns the type that the key is.
	 *
	 * @param __key The key to use.
	 * @return The {@link ConfigRomType}.
	 * @throws NoSuchElementException If no such key exists.
	 * @since 2020/05/03
	 */
	public final int type(int __key)
		throws NoSuchElementException
	{
		return this.getByKey(__key).type();

	}
}