dmolony-DiskBrowser/src/com/bytezone/diskbrowser/applefile/BasicProgram.java

52 lines
1.9 KiB
Java
Raw Normal View History

2019-08-09 23:45:49 +00:00
package com.bytezone.diskbrowser.applefile;
import com.bytezone.diskbrowser.gui.BasicPreferences;
2020-09-13 00:22:49 +00:00
// -----------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
public abstract class BasicProgram extends AbstractFile
2020-09-13 00:22:49 +00:00
// -----------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
{
static final byte ASCII_QUOTE = 0x22;
static final byte ASCII_COLON = 0x3A;
static final byte ASCII_SEMI_COLON = 0x3B;
static final byte ASCII_CARET = 0x5E;
2019-09-04 20:44:43 +00:00
static BasicPreferences basicPreferences; // set by MenuHandler
2019-08-09 23:45:49 +00:00
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
public static void setBasicPreferences (BasicPreferences basicPreferences)
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
{
2019-09-04 20:44:43 +00:00
BasicProgram.basicPreferences = basicPreferences;
2019-08-09 23:45:49 +00:00
}
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
public BasicProgram (String name, byte[] buffer)
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
{
super (name, buffer);
}
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-09-04 20:44:43 +00:00
boolean isHighBitSet (byte value)
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
{
return (value & 0x80) != 0;
}
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
boolean isControlCharacter (byte value)
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
{
2019-09-04 20:44:43 +00:00
int val = value & 0xFF;
return val > 0 && val < 32;
2019-08-09 23:45:49 +00:00
}
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
boolean isDigit (byte value)
2020-09-13 00:22:49 +00:00
// ---------------------------------------------------------------------------------//
2019-08-09 23:45:49 +00:00
{
return value >= 48 && value <= 57;
}
}