jrt

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: EPL-2.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jrt hand-writes small Go stand-ins for the java.lang/java.util base types that some translated SWT classes extend (SWTException/SWTError extend RuntimeException/Error, TypedEvent extends EventObject) but that have no Java source for j2go to translate - see tooling/j2go/README.md "Manual superclass embedding". Registered via the same Manual.isManual/manual.txt mechanism as Monitor/RoundingMode.

Package jrt: java.lang.reflect subset ControlExample's Set/Get dialog needs (Tab.java's getValue/setValue/getReturnType/parameterInfo) - see tooling/j2go/README.md "Round 10 reflection". java.lang.Class itself stays reflect.Type (Manual.java); this file adds getMethod/invoke/getReturnType/isArray/getComponentType/getName on top of it.

The obvious implementation - resolve the Java method name to a Go name, then call reflect.Type.MethodByName/Method(i) - is deliberately not used: the Go linker sees any static call to those two APIs and, unable to tell which name will be looked up at runtime, keeps every exported method of every reflect-reachable type in the binary (defeats dead-code elimination program-wide). Instead j2go generates package swt/swtreflect, whose init() registers each public method of the translated widgets-package classes as a closure naming its concrete types statically. Only programs importing swtreflect keep those methods (README "Round 11"). Inherited (promoted) methods are found by walking the embedding chain at lookup time (parentOf) and dispatched through Narrow, both using only struct-field reflection (Field/ Addr/Interface), never Method/MethodByName.

Index

Constants

View Source
const (
	CalendarERA          = 0
	CalendarYEAR         = 1
	CalendarMONTH        = 2
	CalendarDAY_OF_MONTH = 5
	CalendarDAY_OF_WEEK  = 7
	CalendarAM_PM        = 9
	CalendarHOUR         = 10
	CalendarHOUR_OF_DAY  = 11
	CalendarMINUTE       = 12
	CalendarSECOND       = 13
	CalendarMILLISECOND  = 14
	CalendarAM           = 0
	CalendarPM           = 1
	CalendarSHORT        = 1
	CalendarLONG         = 2

	DateFormatFULL   = 0
	DateFormatLONG   = 1
	DateFormatMEDIUM = 2
	DateFormatSHORT  = 3

	CharacterIteratorDONE uint16 = 0xFFFF
)
View Source
const (
	FileSeparator            = "/"
	FileSeparatorChar uint16 = '/'
)

java.io.File.separator / separatorChar.

View Source
const NullString = "\x00null"

NullString stands for a Java null String argument written literally in a test; the ported null-argument guards compare against it, since an ordinary "" is a legal String.

View Source
const (
	StatusOK, StatusInfo, StatusWarning, StatusError, StatusCancel = 0, 1, 2, 4, 8
)
View Source
const UNKNOWN = -1

Variables

View Source
var (
	DateFormatFieldERA          = &DateFormatField{"era", CalendarERA}
	DateFormatFieldYEAR         = &DateFormatField{"year", CalendarYEAR}
	DateFormatFieldMONTH        = &DateFormatField{"month", CalendarMONTH}
	DateFormatFieldDAY_OF_MONTH = &DateFormatField{"day of month", CalendarDAY_OF_MONTH}
	DateFormatFieldDAY_OF_WEEK  = &DateFormatField{"day of week", CalendarDAY_OF_WEEK}
	DateFormatFieldHOUR_OF_DAY0 = &DateFormatField{"hour of day", CalendarHOUR_OF_DAY}
	DateFormatFieldHOUR_OF_DAY1 = &DateFormatField{"hour of day 1", CalendarHOUR_OF_DAY}
	DateFormatFieldHOUR0        = &DateFormatField{"hour", CalendarHOUR}
	DateFormatFieldHOUR1        = &DateFormatField{"hour 1", CalendarHOUR}
	DateFormatFieldMINUTE       = &DateFormatField{"minute", CalendarMINUTE}
	DateFormatFieldSECOND       = &DateFormatField{"second", CalendarSECOND}
	DateFormatFieldMILLISECOND  = &DateFormatField{"millisecond", CalendarMILLISECOND}
	DateFormatFieldAM_PM        = &DateFormatField{"am pm", CalendarAM_PM}
	DateFormatFieldTIME_ZONE    = &DateFormatField{"time zone", -1}
)
View Source
var LocaleENGLISH = &Locale{"en"}
View Source
var LocaleGERMAN = &Locale{"de"}
View Source
var StandardCharsetsUTF_8 = &Charset{}
View Source
var SystemProperties = func() *Map {
	m := NewMap()
	m.Put("os.name", javaOSName(runtime.GOOS))
	m.Put("line.separator", LineSeparator())
	return m
}()

SystemProperties backs System.getProperty/setProperty/getProperties; values are strings. os.name is the running OS as a JDK names it (the shared generated files are translated once, for every OS).

Functions

func AddSuppressed

func AddSuppressed(e, s error)

AddSuppressed drops the suppressed error: Go errors carry no suppressed list.

func ArgAs

func ArgAs[T any](a any) T

ArgAs converts one Method.invoke argument (boxed any, nil for Java null) to the registered closure's own parameter type.

func ArraysBinarySearch

func ArraysBinarySearch[T cmp.Ordered](a []T, key T) int32

ArraysBinarySearch is Arrays.binarySearch(array, key): the index, or -(insertion point)-1.

func ArraysFill

func ArraysFill[T any](a []T, v T)

ArraysFill is Arrays.fill(a, v); ArraysFillRange fills [from, to).

func ArraysFillRange

func ArraysFillRange[T any](a []T, from, to int32, v T)

func ArraysSortComparator

func ArraysSortComparator[T any](a []T, c func(T, T) int32)

ArraysSortComparator is Arrays.sort(T[], Comparator): stable, like Java's object sort.

func AsWriter

func AsWriter(s OutputStream) io.Writer

func AssertIsLegal

func AssertIsLegal(expr bool, msg ...string) bool

func AssertIsNotNull

func AssertIsNotNull(object any, msg ...string)

func AssertIsTrue

func AssertIsTrue(expr bool, msg ...string) bool

func Cast

func Cast[T any](x any) T

Cast is a Java reference cast of an erased generic result (Map.get, Queue.poll): nil stays the zero value instead of panicking like a bare Go type assertion would. A subclass pointer (*CTabItem held as a Widget) is walked down to the superclass embedding.

func CharAt

func CharAt(s string, i int32) uint16

CharAt is String.charAt(i): the i-th UTF-16 unit of s, amortized O(1) in a loop over one string. Out of range panics like the ToChars(s)[i] it replaces.

func ClassCast

func ClassCast(t reflect.Type, o any) any

ClassCast is Class.cast: the object itself, or a ClassCastException-shaped RuntimeException.

func ClassForName

func ClassForName(name string) reflect.Type

ClassForName is Class.forName, which SWT only calls to force a class's static initializer - Go package init has already run all of them.

func ClassIsInstance

func ClassIsInstance(t reflect.Type, o any) bool

ClassIsInstance is Class.isInstance: null is an instance of nothing.

func ClassName

func ClassName(t reflect.Type) string

ClassName is java.lang.Class#getName(): JVM primitive names and array-descriptor syntax exactly (what the Set/Get dialog branches on), plus a best-effort "org.eclipse.swt.widgets. <Name>" guess for a pointer-to-struct type outside classPackages - wrong package for e.g. a layout type, harmless since every caller (Widget.getName(), every toString()) only keeps the tail after the last '.'. Upgrade path: a translator-emitted per-class Java-FQN registry.

func CollectionsMax

func CollectionsMax[T any](c *List, cmp func(T, T) int32) T

func CollectionsSort

func CollectionsSort(l *List, comparator ...any)

CollectionsSort is Collections.sort(list) for strings and numbers, or with a comparator func(a, b T) int32.

func CompareTo

func CompareTo(a, b any) int32

CompareTo is Comparable.compareTo on a receiver held as any: its own CompareTo, else the natural order of numbers and strings.

func ComparingInt

func ComparingInt[T any](key func(T) int32) func(T, T) int32

ComparingInt is Comparator.comparingInt.

func CopyOf

func CopyOf[T any](a []T, n int32) []T

CopyOf is Arrays.copyOf: truncated or zero-padded to n.

func CurrentThread

func CurrentThread() any

CurrentThread is Thread.currentThread() as a comparable identity: the goroutine id (the UI goroutine is locked to the main OS thread, so this is also the AppKit thread check).

func CurrentTimeMillis

func CurrentTimeMillis() int64

CurrentTimeMillis is System.currentTimeMillis().

func Directionality

func Directionality(c rune) int8

Directionality is Character.getDirectionality for the blocks SWT's BidiUtil tells apart: Hebrew 1, Arabic 2, other letters 0, digits 3, space 12, else 13 (other neutral). Ceiling: no full UCD bidi class table; swap in golang.org/x/text/unicode/bidi if needed.

func DoubleCompare

func DoubleCompare(a, b float64) int32

DoubleCompare is Double.compare: NaN sorts last and equals itself, -0.0 < 0.0.

func DoubleEquals

func DoubleEquals(a float64, b any) bool

DoubleEquals is Double.equals(Object): the other must be a Double with the same value.

func DoubleHashCode

func DoubleHashCode(d float64) int32

DoubleHashCode is Double.hashCode(d).

func DoubleToInt

func DoubleToInt(d float64) int32

DoubleToInt is Double.intValue(): NaN is 0, out-of-range values saturate.

func DoubleToString

func DoubleToString(f float64) string

DoubleToString is Double.toString for the plain decimal range ("1.0", not "1").

func FilesCopy

func FilesCopy(src any, dst *Path, _ []any) int64

FilesCopy is copy(InputStream, Path) and copy(Path, Path); like Java it refuses to overwrite.

func FilesDelete

func FilesDelete(p *Path)

func FilesDeleteIfExists

func FilesDeleteIfExists(p *Path) bool

func FilesIsRegularFile

func FilesIsRegularFile(p *Path, _ []any) bool
func FilesIsSymbolicLink(p *Path) bool

func FilesReadAllBytes

func FilesReadAllBytes(p *Path) []int8

func Fill

func Fill[T any](a []T, v T)

Fill is Arrays.fill(a, v).

func Format

func Format(format string, args []any) string

Format is String.format(fmt, args...) for the conversions Go shares with Java (%d %s %x %02X); %n is a newline.

func FromChars

func FromChars(u []uint16) string

FromChars is new String(char[]): a valid pair becomes one rune, a lone surrogate WTF-8 (see ToChars).

func GC

func GC()

GC is System.gc().

func GetBytes

func GetBytes(s string) []int8

GetBytes is String.getBytes(): the UTF-8 bytes as Java's signed bytes.

func GetChars

func GetChars(s string, srcBegin, srcEnd int32, dst []uint16, dstBegin int32)

GetChars is String.getChars: the UTF-16 units [srcBegin, srcEnd) of s copied into dst at dstBegin.

func GetInteger

func GetInteger(key string, def int32) int32

GetInteger is Integer.getInteger(key, def): the property parsed as a number, def when unset or not one.

func GetProperty

func GetProperty(key, def string) string

GetProperty is System.getProperty(key, def); an unset key with no default is the port's null String, "".

func Getenv

func Getenv(name string) string

Getenv is System.getenv(name): "" for an unset variable.

func Goid

func Goid() uint64

Goid is the current goroutine id without boxing, for thread checks on hot paths.

func HashCodeOf

func HashCodeOf(x any) int32

HashCodeOf is Object.hashCode() on a receiver whose static type has no Go method for it.

func IdentityHashCode

func IdentityHashCode(x any) int32

IdentityHashCode is Object.hashCode: Go's heap objects don't move, so the address is stable.

func Ignore

func Ignore(...any)

Ignore evaluates its arguments for their side effects only: Thread.interrupt and setDaemon, which a goroutine does not have.

func IndexFrom

func IndexFrom(s, needle string, from int32) int32

IndexFrom is String.indexOf(str, fromIndex) in UTF-16 units.

func Interrupted

func Interrupted() bool

Interrupted is Thread.interrupted(): nothing interrupts a goroutine.

func IsAssignableFrom

func IsAssignableFrom(to, from reflect.Type) bool

IsAssignableFrom is Class.isAssignableFrom for the reflect types the translator uses as Class values.

func IsHighSurrogate

func IsHighSurrogate(c rune) bool

IsHighSurrogate is Character.isHighSurrogate.

func IsNil

func IsNil(v any) bool

IsNil is `x == null` for a Java Object held as any: a typed nil pointer inside the interface is null too.

func JavaVersionFeature

func JavaVersionFeature(version any) int32

JavaVersionFeature is Runtime.version().feature(): there is no JVM, so no Java version.

func LastIndexOf

func LastIndexOf(s, needle string) int32

LastIndexOf is String.lastIndexOf(str) in UTF-16 units.

func LineSeparator

func LineSeparator() string

LineSeparator is System.lineSeparator(): "\r\n" on Windows (StyledText copies text with it).

func LocaleLanguage

func LocaleLanguage(locale any) string

LocaleLanguage is locale.getLanguage() for the default (only) locale: the ISO code from $LANG.

func Matches

func Matches(s, regex string) bool

Matches is String.matches: the whole string must match.

func MessageFormatFormat

func MessageFormatFormat(pattern string, args []any) string

MessageFormatFormat is MessageFormat.format(pattern, args): {n} is replaced by fmt.Sprint(args[n]) and ” is a literal quote. Not supported: {n,number,...} format types, quoted literal sections.

func MonitorEnter

func MonitorEnter()

func MonitorExit

func MonitorExit()

func MonitorNotifyAll

func MonitorNotifyAll()

func MonitorWait

func MonitorWait()

MonitorWait is Object.wait(): releases the monitor fully, sleeps until notified, re-acquires.

func Narrow

func Narrow[T any](target any) T

Narrow gives a registered method's closure the *DeclaringClass pointer it needs to call itself, from whatever concrete leaf type ClassGetMethod was actually asked about (target may be *Button while the method is declared on *Control) - the address of the field-0 chain's matching link, exactly what Go's own method promotion uses. Struct-field reflection only, see the package doc.

func NullToEmpty

func NullToEmpty(s string) string

NullToEmpty turns the NullString sentinel back into "" where a null String result is used as a plain value.

func NumberDouble

func NumberDouble(n any) float64

NumberDouble is Number.doubleValue() on a boxed number of whatever kind the value came as.

func ObjectsEquals

func ObjectsEquals(a, b any) bool

ObjectsEquals is Objects.equals(a, b): a typed nil pointer counts as null.

func ObjectsHash

func ObjectsHash(values ...any) int32

ObjectsHash is Objects.hash(values...), i.e. Arrays.hashCode of the boxed values.

func ParseDouble

func ParseDouble(s string) float64

ParseDouble is Double.parseDouble.

func ParseFloat

func ParseFloat(s string) float32

ParseFloat is Float.parseFloat.

func ParseInt

func ParseInt(s string) int32

ParseInt is Integer.parseInt: a NumberFormatException panic on bad input or int overflow.

func ParseIntRadix

func ParseIntRadix(s string, radix int32) int32

ParseIntRadix is Integer.parseInt(s, radix).

func ParseLong

func ParseLong(s string) int64

ParseLong is Long.parseLong/Long.valueOf(String).

func PeekBytes

func PeekBytes(s InputStream, n int) (head []byte, ok bool)

PeekBytes returns up to n leading bytes of a stream and rewinds it, like FileFormat's mark/reset sniffing; ok is false for a stream that cannot rewind (only files and byte arrays can).

func PrintStreamFlush

func PrintStreamFlush(s PrintStream)

PrintStreamFlush is PrintStream.flush on a stream of either kind.

func ReadAllBytes

func ReadAllBytes(s InputStream) []int8

ReadAllBytes is java.io.InputStream.readAllBytes(): read until EOF.

func RegisterClassPackage

func RegisterClassPackage(goName, javaPackage string)

RegisterClassPackage records the Java package of a swt type outside org.eclipse.swt.widgets (generated init, ClassEmitter); ClassName falls back to widgets for the rest.

func RegisterMethod

func RegisterMethod(t reflect.Type, javaName string, paramTypes []reflect.Type, returnType reflect.Type, call func(target any, args []any) any)

RegisterMethod is called from generated code - swt/swtreflect's init() (ReflectEmitter, README "Round 10 reflection").

func RegisterResources

func RegisterResources(f fs.FS)

func RemoveTempDir

func RemoveTempDir(p *Path)

func ReplaceAll

func ReplaceAll(s, regex, repl string) string

func ReplaceFirst

func ReplaceFirst(s, regex, repl string) string

ReplaceFirst and ReplaceAll are String.replaceFirst/replaceAll ($1 group references as in Java).

func SafeRunnerRun

func SafeRunnerRun(r ISafeRunnable)

SafeRunnerRun runs r, routing a panic that is an error to HandleException (SafeRunner.run).

func SetErr

func SetErr(s PrintStream)

SetErr is System.setErr.

func SetOut

func SetOut(s PrintStream)

SetOut is System.setOut: a CapturedStream takes over os.Stdout, the original *os.File gives it back.

func SetProperty

func SetProperty(key, value string) string

SetProperty is System.setProperty: the previous value, "" when unset.

func Sleep

func Sleep(millis int64)

Sleep is Thread.sleep(millis).

func Split

func Split(s, regex string) []string

Split is String.split(regex): trailing empty strings are dropped.

func StringCompareTo

func StringCompareTo(a, b string) int32

StringCompareTo is String.compareTo: UTF-16 code units, the difference of the first mismatch or of the lengths.

func StringFromBytes

func StringFromBytes(b []int8) string

StringFromBytes is new String(byte[], UTF_8).

func StringHashCode

func StringHashCode(s string) int32

StringHashCode is String.hashCode(): h = 31*h + c over the UTF-16 code units.

func StringLength

func StringLength(s string) int32

StringLength is String.length(): UTF-16 code units, so a length sizes a getChars buffer.

func Substring

func Substring(s string, start, end int32) string

Substring is String.substring(start, end) over UTF-16 indices; end < 0 means to the end.

func TakeScreenshot

func TakeScreenshot(testClass any, name string) string

TakeScreenshot is org.eclipse.test.Screenshots.takeScreenshot: the runner captures nothing.

func ThenComparing

func ThenComparing[T any](first func(T, T) int32, next any) func(T, T) int32

ThenComparing is Comparator.thenComparing(Comparator) or thenComparing(Function): next is a func(T, T) int32 or a key extractor returning an ordered value.

func ThreadIsAlive

func ThreadIsAlive(t any) bool

ThreadIsAlive is Thread.isAlive: started and not yet finished.

func ThreadJoin

func ThreadJoin(t any)

func ThreadStart

func ThreadStart(t any)

func ToChars

func ToChars(s string) []uint16

Ceiling: a pair cut by Substring and joined with Go + is two 3-byte units, not the 4-byte rune. Length, index, hash and compareTo are right; ==, map keys and HasPrefix see different bytes. Upgrade: a jrt.Concat in the generator that re-encodes the joined units. ToChars is String.toCharArray(): the UTF-16 units of s. A lone surrogate is kept as WTF-8 (ED A0..BF xx), which Substring produces when it cuts an emoji pair; two such halves concatenated with + read back as the pair.

func ToLowerCase

func ToLowerCase(s string) string

ToLowerCase is String.toLowerCase().

func ToSlice

func ToSlice[T any](l *List) []T

ToSlice is list.toArray(new T[0]): the snapshot as a typed slice (nil elements stay zero).

func ToUpperCase

func ToUpperCase(s string) string

ToUpperCase is String.toUpperCase().

func URLDecoderDecode

func URLDecoderDecode(s string, _ *Charset) string

func URLEncoderEncode

func URLEncoderEncode(s string, _ *Charset) string

func ValidUTF8

func ValidUTF8(s string) string

ValidUTF8 is for text handed to the OS: surrogate pairs held as two WTF-8 halves are joined, a lone surrogate becomes U+FFFD, since Cocoa and GTK reject invalid UTF-8.

func WriteBytes

func WriteBytes(o OutputStream, b []int8)

WriteBytes is OutputStream.write(byte[]).

func Yield

func Yield()

Yield is Thread.yield().

Types

type Assert

type Assert struct{}

Assert mirrors org.eclipse.core.runtime.Assert; msg is Java's optional second argument.

type AssertionFailedException

type AssertionFailedException struct{ RuntimeException }

AssertionFailedException is what Assert.isTrue/isNotNull throw.

type AtomicBoolean

type AtomicBoolean struct {
	// contains filtered or unexported fields
}

AtomicBoolean, AtomicInteger and AtomicReference are java.util.concurrent.atomic's cells; the constructors take Java's optional initial value.

func NewAtomicBoolean

func NewAtomicBoolean(initial ...bool) *AtomicBoolean

func (*AtomicBoolean) CompareAndSet

func (a *AtomicBoolean) CompareAndSet(expected, v bool) bool

func (*AtomicBoolean) Get

func (a *AtomicBoolean) Get() bool

func (*AtomicBoolean) GetAndSet

func (a *AtomicBoolean) GetAndSet(v bool) bool

func (*AtomicBoolean) GetPlain

func (a *AtomicBoolean) GetPlain() bool

func (*AtomicBoolean) Set

func (a *AtomicBoolean) Set(v bool)

func (*AtomicBoolean) SetPlain

func (a *AtomicBoolean) SetPlain(v bool)

type AtomicInteger

type AtomicInteger struct {
	// contains filtered or unexported fields
}

func NewAtomicInteger

func NewAtomicInteger(initial ...int32) *AtomicInteger

func (*AtomicInteger) AddAndGet

func (a *AtomicInteger) AddAndGet(d int32) int32

func (*AtomicInteger) CompareAndSet

func (a *AtomicInteger) CompareAndSet(expected, v int32) bool

func (*AtomicInteger) DecrementAndGet

func (a *AtomicInteger) DecrementAndGet() int32

func (*AtomicInteger) Get

func (a *AtomicInteger) Get() int32

func (*AtomicInteger) GetAndAdd

func (a *AtomicInteger) GetAndAdd(d int32) int32

func (*AtomicInteger) GetAndIncrement

func (a *AtomicInteger) GetAndIncrement() int32

func (*AtomicInteger) GetAndSet

func (a *AtomicInteger) GetAndSet(v int32) int32

func (*AtomicInteger) GetPlain

func (a *AtomicInteger) GetPlain() int32

func (*AtomicInteger) IncrementAndGet

func (a *AtomicInteger) IncrementAndGet() int32

func (*AtomicInteger) IntValue

func (a *AtomicInteger) IntValue() int32

func (*AtomicInteger) Set

func (a *AtomicInteger) Set(v int32)

func (*AtomicInteger) SetPlain

func (a *AtomicInteger) SetPlain(v int32)

type AtomicIntegerArray

type AtomicIntegerArray struct {
	// contains filtered or unexported fields
}

AtomicIntegerArray and AtomicReferenceArray are the fixed-size arrays of cells.

func NewAtomicIntegerArray

func NewAtomicIntegerArray(n int32) *AtomicIntegerArray

func (*AtomicIntegerArray) Get

func (a *AtomicIntegerArray) Get(i int32) int32

func (*AtomicIntegerArray) Length

func (a *AtomicIntegerArray) Length() int32

func (*AtomicIntegerArray) Set

func (a *AtomicIntegerArray) Set(i, x int32)

func (*AtomicIntegerArray) ToString

func (a *AtomicIntegerArray) ToString() string

type AtomicLong

type AtomicLong struct {
	// contains filtered or unexported fields
}

func NewAtomicLong

func NewAtomicLong(initial ...int64) *AtomicLong

func (*AtomicLong) AddAndGet

func (a *AtomicLong) AddAndGet(d int64) int64

func (*AtomicLong) CompareAndSet

func (a *AtomicLong) CompareAndSet(expected, v int64) bool

func (*AtomicLong) DecrementAndGet

func (a *AtomicLong) DecrementAndGet() int64

func (*AtomicLong) Get

func (a *AtomicLong) Get() int64

func (*AtomicLong) GetAndAdd

func (a *AtomicLong) GetAndAdd(d int64) int64

func (*AtomicLong) GetAndIncrement

func (a *AtomicLong) GetAndIncrement() int64

func (*AtomicLong) GetAndSet

func (a *AtomicLong) GetAndSet(v int64) int64

func (*AtomicLong) GetPlain

func (a *AtomicLong) GetPlain() int64

func (*AtomicLong) IncrementAndGet

func (a *AtomicLong) IncrementAndGet() int64

func (*AtomicLong) LongValue

func (a *AtomicLong) LongValue() int64

func (*AtomicLong) Set

func (a *AtomicLong) Set(v int64)

func (*AtomicLong) SetPlain

func (a *AtomicLong) SetPlain(v int64)

type AtomicReference

type AtomicReference struct {
	// contains filtered or unexported fields
}

func NewAtomicReference

func NewAtomicReference(initial ...any) *AtomicReference

func (*AtomicReference) Get

func (a *AtomicReference) Get() any

func (*AtomicReference) GetAndSet

func (a *AtomicReference) GetAndSet(v any) any

func (*AtomicReference) GetPlain

func (a *AtomicReference) GetPlain() any

func (*AtomicReference) Set

func (a *AtomicReference) Set(v any)

func (*AtomicReference) SetPlain

func (a *AtomicReference) SetPlain(v any)

type AtomicReferenceArray

type AtomicReferenceArray struct {
	// contains filtered or unexported fields
}

func NewAtomicReferenceArray

func NewAtomicReferenceArray(n int32) *AtomicReferenceArray

func (*AtomicReferenceArray) Get

func (a *AtomicReferenceArray) Get(i int32) any

func (*AtomicReferenceArray) Length

func (a *AtomicReferenceArray) Length() int32

func (*AtomicReferenceArray) Set

func (a *AtomicReferenceArray) Set(i int32, x any)

func (*AtomicReferenceArray) ToString

func (a *AtomicReferenceArray) ToString() string

type AttributedCharacterIterator

type AttributedCharacterIterator struct {
	// contains filtered or unexported fields
}

AttributedCharacterIterator: the formatted text, one run per field or literal.

func (*AttributedCharacterIterator) Current

func (it *AttributedCharacterIterator) Current() uint16

func (*AttributedCharacterIterator) First

func (it *AttributedCharacterIterator) First() uint16

func (*AttributedCharacterIterator) GetAttributes

func (it *AttributedCharacterIterator) GetAttributes() *Map

func (*AttributedCharacterIterator) GetRunLimit

func (it *AttributedCharacterIterator) GetRunLimit() int32

func (*AttributedCharacterIterator) GetRunStart

func (it *AttributedCharacterIterator) GetRunStart() int32

func (*AttributedCharacterIterator) Next

func (*AttributedCharacterIterator) SetIndex

func (it *AttributedCharacterIterator) SetIndex(i int32) uint16

type BufferedReader

type BufferedReader = Reader

The reader classes share one Go type; each constructor keeps its Java name.

type ByteArrayInputStream

type ByteArrayInputStream struct {
	// contains filtered or unexported fields
}

ByteArrayInputStream is java.io.ByteArrayInputStream.

func NewByteArrayInputStream

func NewByteArrayInputStream(buf []int8) *ByteArrayInputStream

func (*ByteArrayInputStream) Close

func (s *ByteArrayInputStream) Close()

func (*ByteArrayInputStream) Read

func (s *ByteArrayInputStream) Read() int32

func (*ByteArrayInputStream) ReadRange

func (s *ByteArrayInputStream) ReadRange(b []int8, off, length int32) int32

type ByteArrayOutputStream

type ByteArrayOutputStream struct {
	// contains filtered or unexported fields
}

ByteArrayOutputStream is java.io.ByteArrayOutputStream.

func NewByteArrayOutputStream

func NewByteArrayOutputStream() *ByteArrayOutputStream

func (*ByteArrayOutputStream) Close

func (s *ByteArrayOutputStream) Close()

func (*ByteArrayOutputStream) Flush

func (s *ByteArrayOutputStream) Flush()

func (*ByteArrayOutputStream) Size

func (s *ByteArrayOutputStream) Size() int32

func (*ByteArrayOutputStream) ToByteArray

func (s *ByteArrayOutputStream) ToByteArray() []int8

func (*ByteArrayOutputStream) ToString

func (s *ByteArrayOutputStream) ToString(charset ...any) string

ToString is toString() and toString(Charset): the bytes as UTF-8, the only charset used.

func (*ByteArrayOutputStream) Write

func (s *ByteArrayOutputStream) Write(b int32)

func (*ByteArrayOutputStream) WriteRange

func (s *ByteArrayOutputStream) WriteRange(b []int8, off, length int32)

type Calendar

type Calendar struct {
	// contains filtered or unexported fields
}

Calendar normalizes raw fields on read, like a lenient GregorianCalendar (Jan 31 + month 1 = Mar 3).

func CalendarGetInstance

func CalendarGetInstance(locale ...any) *Calendar

func (*Calendar) Clone

func (c *Calendar) Clone() any

func (*Calendar) Get

func (c *Calendar) Get(field int32) int32

func (*Calendar) GetActualMaximum

func (c *Calendar) GetActualMaximum(field int32) int32

func (*Calendar) GetActualMinimum

func (c *Calendar) GetActualMinimum(field int32) int32

func (*Calendar) GetDisplayNames

func (c *Calendar) GetDisplayNames(field, style int32, locale any) *Map

GetDisplayNames: long names of a MONTH, DAY_OF_WEEK or AM_PM field (style is ignored).

func (*Calendar) GetMaximum

func (c *Calendar) GetMaximum(field int32) int32

func (*Calendar) GetMinimum

func (c *Calendar) GetMinimum(field int32) int32

func (*Calendar) GetTime

func (c *Calendar) GetTime() *Date

func (*Calendar) Roll

func (c *Calendar) Roll(field, amount int32)

Roll changes one field and wraps inside its range without touching larger fields.

func (*Calendar) Set

func (c *Calendar) Set(a ...int32)

Set is set(field, value) or set(year, month, day).

func (*Calendar) SetTime

func (c *Calendar) SetTime(d *Date)

type CapturedStream

type CapturedStream struct {
	// contains filtered or unexported fields
}

CapturedStream is new PrintStream(out, ...). Made System.out/err by SetOut/SetErr, it receives what the process writes to os.Stdout/os.Stderr, on Flush: Go cannot swap an *os.File for a buffer, so the output goes to a temp file and Flush copies the new bytes into out.

func NewPrintStream

func NewPrintStream(out OutputStream, _ ...any) *CapturedStream

NewPrintStream covers (out), (out, autoFlush) and (out, autoFlush, charset); the bytes are UTF-8 either way.

func (*CapturedStream) Flush

func (c *CapturedStream) Flush()

func (*CapturedStream) Write

func (c *CapturedStream) Write(p []byte) (int, error)

type Charset

type Charset struct{}

Charset stands for java.nio.charset.Charset: everything is UTF-8 here.

type Collections

type Collections struct{}

Collections holds the static helpers the translated sources call: max, emptySet, singleton.

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector is Collectors.joining(sep), toList() or toSet() (kind "list"/"set"; sets keep insertion order).

func CollectorsJoining

func CollectorsJoining(sep string) *Collector

func CollectorsSummingInt

func CollectorsSummingInt(key any) *Collector

CollectorsSummingInt is Collectors.summingInt(ToIntFunction).

func CollectorsToList

func CollectorsToList() *Collector

func CollectorsToSet

func CollectorsToSet() *Collector

type CompletableFuture

type CompletableFuture struct {
	// contains filtered or unexported fields
}

CompletableFuture covers supplyAsync/thenRunAsync and the state queries the tests read. Ceiling: no stages beyond thenRunAsync/thenAccept, no join.

func CompletableFutureAllOf

func CompletableFutureAllOf(fs ...*CompletableFuture) *CompletableFuture

CompletableFutureAllOf is CompletableFuture.allOf: done once every argument is.

func CompletableFutureCompletedFuture

func CompletableFutureCompletedFuture(v any) *CompletableFuture

func CompletableFutureSupplyAsync

func CompletableFutureSupplyAsync[T any](supplier func() T) *CompletableFuture

func NewCompletableFuture

func NewCompletableFuture() *CompletableFuture

func (*CompletableFuture) Complete

func (f *CompletableFuture) Complete(v any) bool

Complete is CompletableFuture.complete: false when the future was already done.

func (*CompletableFuture) Get

func (f *CompletableFuture) Get() any

Get waits for the future and returns its value, nil for one that failed.

func (*CompletableFuture) IsCancelled

func (f *CompletableFuture) IsCancelled() bool

func (*CompletableFuture) IsCompletedExceptionally

func (f *CompletableFuture) IsCompletedExceptionally() bool

func (*CompletableFuture) IsDone

func (f *CompletableFuture) IsDone() bool

func (*CompletableFuture) ThenAccept

func (f *CompletableFuture) ThenAccept(fn func(any)) *CompletableFuture

ThenAccept runs fn with the value as soon as the future is done; the returned future is done after fn.

func (*CompletableFuture) ThenRunAsync

func (f *CompletableFuture) ThenRunAsync(r Runnable, executor any) *CompletableFuture

type CoreException

type CoreException struct {
	RuntimeException
	Status IStatus
}

CoreException wraps an IStatus like org.eclipse.core.runtime.CoreException.

func NewCoreException

func NewCoreException(status IStatus) *CoreException

func (*CoreException) GetStatus

func (e *CoreException) GetStatus() IStatus

type CountDownLatch

type CountDownLatch struct {
	// contains filtered or unexported fields
}

CountDownLatch is java.util.concurrent.CountDownLatch.

func NewCountDownLatch

func NewCountDownLatch(count int32) *CountDownLatch

func (*CountDownLatch) Await

func (l *CountDownLatch) Await(timeout int64, unit TimeUnit) bool

func (*CountDownLatch) CountDown

func (l *CountDownLatch) CountDown()

type DataInputStream

type DataInputStream struct{ InputStream }

DataInputStream is java.io.DataInputStream.

func NewDataInputStream

func NewDataInputStream(in InputStream) *DataInputStream

func (*DataInputStream) Read

func (s *DataInputStream) Read(b ...[]int8) int32

Read is read() and read(byte[]): the byte or the count read, -1 at the end.

func (*DataInputStream) ReadInt

func (s *DataInputStream) ReadInt() int32

func (*DataInputStream) ReadLong

func (s *DataInputStream) ReadLong() int64

type DataOutputStream

type DataOutputStream struct{ OutputStream }

DataOutputStream is java.io.DataOutputStream: big-endian values over an OutputStream.

func NewDataOutputStream

func NewDataOutputStream(out OutputStream) *DataOutputStream

func (*DataOutputStream) Write

func (s *DataOutputStream) Write(b any)

Write is write(int) and write(byte[]).

func (*DataOutputStream) WriteInt

func (s *DataOutputStream) WriteInt(v int32)

func (*DataOutputStream) WriteLong

func (s *DataOutputStream) WriteLong(v int64)

type Date

type Date struct {
	// contains filtered or unexported fields
}

type DateFormat

type DateFormat struct {
	// contains filtered or unexported fields
}

DateFormat is also SimpleDateFormat: every instance is pattern based.

func DateFormatGetDateInstance

func DateFormatGetDateInstance(style int32, locale ...any) *DateFormat

func DateFormatGetTimeInstance

func DateFormatGetTimeInstance(style int32, locale ...any) *DateFormat

func (*DateFormat) Format

func (f *DateFormat) Format(d *Date) string

func (*DateFormat) FormatToCharacterIterator

func (f *DateFormat) FormatToCharacterIterator(d *Date) *AttributedCharacterIterator

func (*DateFormat) GetDateFormatSymbols

func (f *DateFormat) GetDateFormatSymbols() DateFormatSymbols

func (*DateFormat) Parse

func (f *DateFormat) Parse(s string) *Date

Parse reads the pattern strictly (non-lenient ranges) from the start of s; trailing text is ignored like Java.

func (*DateFormat) SetLenient

func (f *DateFormat) SetLenient(l bool)

type DateFormatField

type DateFormatField struct {
	// contains filtered or unexported fields
}

DateFormatField is DateFormat.Field, Format.Field and AttributedCharacterIterator.Attribute.

func (*DateFormatField) Equals

func (f *DateFormatField) Equals(o any) bool

func (*DateFormatField) GetCalendarField

func (f *DateFormatField) GetCalendarField() int32

func (*DateFormatField) String

func (f *DateFormatField) String() string

type DateFormatSymbols

type DateFormatSymbols struct{}

func (DateFormatSymbols) GetAmPmStrings

func (DateFormatSymbols) GetAmPmStrings() []string

type Duration

type Duration struct {
	// contains filtered or unexported fields
}

func DurationBetween

func DurationBetween(a, b *Instant) *Duration

func DurationOfSeconds

func DurationOfSeconds(n int64) *Duration

func (*Duration) IsNegative

func (d *Duration) IsNegative() bool

func (*Duration) Minus

func (d *Duration) Minus(o *Duration) *Duration

func (*Duration) ToMillis

func (d *Duration) ToMillis() int64

func (*Duration) ToNanos

func (d *Duration) ToNanos() int64

type EventObject

type EventObject struct {
	Source any
}

EventObject mirrors java.util.EventObject's one field: the object that fired the event.

func NewEventObject

func NewEventObject(source any) EventObject

NewEventObject rejects a null source; a typed nil pointer boxed in the any is null too.

func (*EventObject) GetSource

func (e *EventObject) GetSource() any

type Executor

type Executor interface{ Execute(Runnable) }

Executor is java.util.concurrent.Executor (translated Display has Execute).

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field is java.lang.reflect.Field of a translated class: a struct field found by its Java name. Struct-field reflection only, so it does not defeat dead-code elimination (see reflect.go).

func ClassGetDeclaredField

func ClassGetDeclaredField(t reflect.Type, name string) *Field

ClassGetDeclaredField is Class#getDeclaredField for a pointer-to-struct type; the Go field keeps the Java name.

func (*Field) Get

func (f *Field) Get(obj any) any

Get is Field#get; unexported fields are read through their address (setAccessible(true) is implied).

type FieldPosition

type FieldPosition struct {
	// contains filtered or unexported fields
}

FieldPosition: the field is a *DateFormatField or nil (new FieldPosition(0)).

func NewFieldPosition

func NewFieldPosition(field any) *FieldPosition

func (*FieldPosition) Equals

func (p *FieldPosition) Equals(o any) bool

func (*FieldPosition) GetBeginIndex

func (p *FieldPosition) GetBeginIndex() int32

func (*FieldPosition) GetEndIndex

func (p *FieldPosition) GetEndIndex() int32

func (*FieldPosition) GetFieldAttribute

func (p *FieldPosition) GetFieldAttribute() *DateFormatField

func (*FieldPosition) SetBeginIndex

func (p *FieldPosition) SetBeginIndex(i int32)

func (*FieldPosition) SetEndIndex

func (p *FieldPosition) SetEndIndex(i int32)

type File

type File struct {
	// contains filtered or unexported fields
}

File is java.io.File over a path.

func NewFile

func NewFile(parts ...any) *File

NewFile covers File(path) and File(parent, child); a parent may be a *File or a string.

func (*File) Delete

func (f *File) Delete() bool

Delete is File.delete().

func (*File) Exists

func (f *File) Exists() bool

func (*File) GetPath

func (f *File) GetPath() string

func (*File) IsDirectory

func (f *File) IsDirectory() bool

func (*File) IsFile

func (f *File) IsFile() bool

func (*File) ListFiles

func (f *File) ListFiles() []*File

ListFiles is File.listFiles(): the directory's entries, nil if it cannot be read.

func (*File) Mkdirs

func (f *File) Mkdirs() bool

type FileInputStream

type FileInputStream struct{ InputStream }

FileInputStream/FileOutputStream are their stream interface plus a name to declare variables with.

func NewFileInputStream

func NewFileInputStream(file any) *FileInputStream

NewFileInputStream/NewFileOutputStream back `new FileInputStream(filename)`/`new FileOutputStream(filename)` (ImageLoader.load/save(String)) - "FileInputStream"/ "FileOutputStream" name no real Go type (see Manual), only these two constructors exist.

type FileOutputStream

type FileOutputStream struct{ OutputStream }

func NewFileOutputStream

func NewFileOutputStream(file any) *FileOutputStream

type FileReader

type FileReader = Reader

The reader classes share one Go type; each constructor keeps its Java name.

type FuncInputStream

type FuncInputStream struct{ ReadFn func() int32 }

FuncInputStream is `new InputStream() { int read() {...} }`: the other methods are InputStream's own.

func (*FuncInputStream) Close

func (s *FuncInputStream) Close()

func (*FuncInputStream) Read

func (s *FuncInputStream) Read() int32

func (*FuncInputStream) ReadRange

func (s *FuncInputStream) ReadRange(b []int8, off, length int32) int32

type HttpExchange

type HttpExchange struct {
	// contains filtered or unexported fields
}

HttpExchange is one request being answered; SendResponseHeaders(code, length) with length -1 means no body.

func (*HttpExchange) Close

func (e *HttpExchange) Close()

Close ends the exchange: the handler's return does that anyway. Closing before any header was sent drops the connection, as the JDK server does; a writer that cannot hijack gets an empty 200 instead.

func (*HttpExchange) GetRequestBody

func (e *HttpExchange) GetRequestBody() InputStream

func (*HttpExchange) GetRequestMethod

func (e *HttpExchange) GetRequestMethod() string

func (*HttpExchange) GetRequestURI

func (e *HttpExchange) GetRequestURI() *URI

func (*HttpExchange) GetResponseBody

func (e *HttpExchange) GetResponseBody() OutputStream

func (*HttpExchange) GetResponseHeaders

func (e *HttpExchange) GetResponseHeaders() *HttpHeaders

func (*HttpExchange) SendResponseHeaders

func (e *HttpExchange) SendResponseHeaders(code int32, length int64)

type HttpHeaders

type HttpHeaders struct {
	// contains filtered or unexported fields
}

func (*HttpHeaders) Set

func (h *HttpHeaders) Set(k, v string)

type HttpServer

type HttpServer struct {
	// contains filtered or unexported fields
}

HttpServer is com.sun.net.httpserver.HttpServer on a loopback listener.

func HttpServerCreate

func HttpServerCreate(addr *InetSocketAddress, _ int32) *HttpServer

func (*HttpServer) CreateContext

func (s *HttpServer) CreateContext(path string, h func(*HttpExchange))

func (*HttpServer) GetAddress

func (s *HttpServer) GetAddress() *InetSocketAddress

func (*HttpServer) Start

func (s *HttpServer) Start()

func (*HttpServer) Stop

func (s *HttpServer) Stop(delay int32)

type IOException

type IOException struct{ Message string }

IOException is java.io.IOException: a pointer so the panic value satisfies Go's error interface (see ControlFlowEmitter's concrete-catch type assertion).

func NewIOException

func NewIOException(arg ...any) *IOException

func (*IOException) Error

func (e *IOException) Error() string

type IProgressMonitor

type IProgressMonitor interface {
	BeginTask(name string, totalWork int32)
	Done()
	InternalWorked(work float64)
	IsCanceled() bool
	SetCanceled(value bool)
	SetTaskName(name string)
	SubTask(name string)
	Worked(work int32)
}

type ISafeRunnable

type ISafeRunnable interface {
	HandleException(exception error)
	Run()
}

ISafeRunnable is org.eclipse.core.runtime.ISafeRunnable.

type IStatus

type IStatus interface {
	GetSeverity() int32
	GetMessage() string
	GetPlugin() string
	GetCode() int32
	GetException() error
	IsOK() bool
}

IStatus is org.eclipse.core.runtime.IStatus; Status below implements it.

type IllegalArgumentException

type IllegalArgumentException struct {
	Message string
	Cause   error
}

func NewIllegalArgumentException

func NewIllegalArgumentException(args ...any) *IllegalArgumentException

NewIllegalArgumentException covers Java's (), (String), (Throwable) and (String, Throwable).

func (*IllegalArgumentException) Error

func (e *IllegalArgumentException) Error() string

func (*IllegalArgumentException) GetMessage

func (e *IllegalArgumentException) GetMessage() string

func (*IllegalArgumentException) Unwrap

func (e *IllegalArgumentException) Unwrap() error

type IndexOutOfBoundsException

type IndexOutOfBoundsException struct{ RuntimeException }

func NewIndexOutOfBoundsException

func NewIndexOutOfBoundsException(args ...any) *IndexOutOfBoundsException

type InetAddress

type InetAddress struct {
	// contains filtered or unexported fields
}

func InetAddressGetLoopbackAddress

func InetAddressGetLoopbackAddress() *InetAddress

type InetSocketAddress

type InetSocketAddress struct {
	// contains filtered or unexported fields
}

func NewInetSocketAddress

func NewInetSocketAddress(addr *InetAddress, port int32) *InetSocketAddress

func (*InetSocketAddress) GetPort

func (a *InetSocketAddress) GetPort() int32

type InputStream

type InputStream interface {
	Read() int32
	ReadRange(b []int8, off, length int32) int32
	Close()
}

InputStream mirrors the java.io.InputStream methods ImageLoader.java's translated code uses: Read/ReadRange return -1 at end of stream, matching Java's read()/read(byte[],off,len). []int8 is this codebase's Go spelling of byte[] (see GoTypes). None of the ported code catches a per-call I/O error, so there is no error return - a real failure panics with an IOException.

func ClassGetResourceAsStream

func ClassGetResourceAsStream(class any, name string) InputStream

ClassGetResourceAsStream is Class.getResourceAsStream: the class is ignored, names resolve against the one registered resource FS.

func FilesNewInputStream

func FilesNewInputStream(p *Path, _ []any) InputStream

func GetResourceAsStream

func GetResourceAsStream(name string) InputStream

GetResourceAsStream is Class.getResourceAsStream(name): nil if no FS was registered or name isn't in it, matching Java's own "resource not found" return.

func NewInputStream

func NewInputStream(r io.Reader) InputStream

NewInputStream wraps a Go io.Reader - a file, an embedded resource, a byte slice - as the InputStream ImageLoader.java's translated code and the image codec wrapper read from.

type InputStreamReader

type InputStreamReader = Reader

The reader classes share one Go type; each constructor keeps its Java name.

type Instant

type Instant struct {
	// contains filtered or unexported fields
}

Instant and Duration are java.time's, over time.Time and time.Duration.

func InstantNow

func InstantNow() *Instant

func (*Instant) IsAfter

func (i *Instant) IsAfter(o *Instant) bool

func (*Instant) IsBefore

func (i *Instant) IsBefore(o *Instant) bool

func (*Instant) PlusMillis

func (i *Instant) PlusMillis(n int64) *Instant

func (*Instant) PlusSeconds

func (i *Instant) PlusSeconds(n int64) *Instant

type InterruptedException

type InterruptedException struct{ RuntimeException }

func NewInterruptedException

func NewInterruptedException(args ...any) *InterruptedException

type InvocationTargetException

type InvocationTargetException struct{ Cause error }

InvocationTargetException is java.lang.reflect.InvocationTargetException.

func (*InvocationTargetException) Error

func (e *InvocationTargetException) Error() string

func (*InvocationTargetException) Unwrap

func (e *InvocationTargetException) Unwrap() error

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

Iterator is java.util.Iterator over a List snapshot; Remove deletes the last returned element from the list.

func (*Iterator) HasNext

func (it *Iterator) HasNext() bool

func (*Iterator) Next

func (it *Iterator) Next() any

func (*Iterator) Remove

func (it *Iterator) Remove()

type JavaError

type JavaError struct {
	Message string
	Cause   error
}

Named JavaError, not Error: an embedded field literally named "Error" would shadow its own promoted Error() method, so *SWTError would silently stop satisfying Go's error interface.

func NewJavaError

func NewJavaError(message string) JavaError

func (*JavaError) Error

func (e *JavaError) Error() string

func (*JavaError) GetMessage

func (e *JavaError) GetMessage() string

func (*JavaError) PrintStackTrace

func (e *JavaError) PrintStackTrace()

func (*JavaError) Unwrap

func (e *JavaError) Unwrap() error

type List

type List struct {
	// contains filtered or unexported fields
}

List stands in for java.util.List/ArrayList and ConcurrentLinkedQueue. The mutex covers the queue use (Synchronizer.asyncExec may be called off the UI goroutine).

func ArraysAsList

func ArraysAsList(array any) *List

ArraysAsList is Arrays.asList(array) for any slice type.

func CollectionsEmptySet

func CollectionsEmptySet() *List

func CollectionsSingleton

func CollectionsSingleton(v any) *List

func CollectionsSynchronizedList

func CollectionsSynchronizedList(l *List) *List

func CollectionsSynchronizedSet

func CollectionsSynchronizedSet(l *List) *List

func CollectionsUnmodifiableList

func CollectionsUnmodifiableList(l *List) *List

The Collections wrappers return the list itself: the translated tests are single-threaded and never write through the original after wrapping, so a copy or a lock would only hide a bug.

func IntStreamOf

func IntStreamOf(values ...int32) *List

IntStreamOf is IntStream.of(values...).

func IntStreamRange

func IntStreamRange(from, to int32) *List

IntStreamRange is IntStream.range(from, to).

func ListCopyOf

func ListCopyOf(l *List) *List

ListCopyOf is List.copyOf.

func ListOf

func ListOf(elems ...any) *List

ListOf is List.of(e1, e2, ...). A lone array of references ([]any, []*Control, []string...) is the varargs array of Stream.of(T...) / Arrays.asList(T...), spread as Java does; a lone primitive array (int[]) stays one element, as in Java.

func NewList

func NewList(arg ...any) *List

NewList is new ArrayList<>(), new ArrayList<>(initialCapacity) or new ArrayList<>(collection).

func StringChars

func StringChars(s string) *List

StringChars is String.chars(): the UTF-16 code units.

func (*List) Add

func (l *List) Add(a ...any) bool

Add covers add(E) and add(int index, E).

func (*List) AddAll

func (l *List) AddAll(other *List) bool

func (*List) AllMatch

func (l *List) AllMatch(pred any) bool

func (*List) AnyMatch

func (l *List) AnyMatch(pred any) bool

func (*List) Clear

func (l *List) Clear()

func (*List) Collect

func (l *List) Collect(c *Collector) any

Collect covers joining, toList and toSet; the caller asserts the Java result type.

func (*List) CollectInto

func (l *List) CollectInto(supplier, accumulator any) any

CollectInto is the sequential collect(supplier, accumulator, combiner).

func (*List) Contains

func (l *List) Contains(v any) bool

Contains is List.contains(Object).

func (*List) Count

func (l *List) Count() int64

Count is Stream.count().

func (*List) Distinct

func (l *List) Distinct() *List

func (*List) Equals

func (l *List) Equals(o any) bool

Equals is List.equals: the same elements in the same order.

func (*List) Filter

func (l *List) Filter(pred any) *List

func (*List) FlatMapToInt

func (l *List) FlatMapToInt(fn any) *List

func (*List) ForEach

func (l *List) ForEach(action any)

ForEach is Iterable.forEach(Consumer): the action is a Go func of the element type (or an untyped marker), called through reflect because the list itself is erased to any.

func (*List) ForEachOrdered

func (l *List) ForEachOrdered(action any)

ForEachOrdered is Stream.forEachOrdered: streams here are lists, already in order.

func (*List) Get

func (l *List) Get(i int32) any

func (*List) GetFirst

func (l *List) GetFirst() any

LinkedList / deque members on List.

func (*List) GetLast

func (l *List) GetLast() any

func (*List) IndexOf

func (l *List) IndexOf(v any) int32

func (*List) IsEmpty

func (l *List) IsEmpty() bool

func (*List) Iterator

func (l *List) Iterator() *Iterator

func (*List) Map

func (l *List) Map(fn any) *List

func (*List) MapToInt

func (l *List) MapToInt(fn any) *List

Stream stages the translated code uses beyond Map/Filter: the values stay boxed in any, the lambda's own Go types do the work.

func (*List) MapToObj

func (l *List) MapToObj(fn any) *List

func (*List) NoneMatch

func (l *List) NoneMatch(pred any) bool

func (*List) Peek

func (l *List) Peek() any

func (*List) Poll

func (l *List) Poll() any

func (*List) Remove

func (l *List) Remove(v any) bool

Remove is java.util.List.remove(Object): drops the first equal element.

func (*List) RemoveAll

func (l *List) RemoveAll(other *List) bool

RemoveAll is List.removeAll: drops every element that other contains.

func (*List) RemoveFirst

func (l *List) RemoveFirst() any

func (*List) RemoveIf

func (l *List) RemoveIf(predicate any) bool

RemoveIf takes Java's Predicate as a func(any) bool; typed any because a translated method-reference argument has no Go type of its own yet.

func (*List) Size

func (l *List) Size() int32

func (*List) Skip

func (l *List) Skip(n int64) *List

func (*List) Sorted

func (l *List) Sorted() *List

Sorted is IntStream.sorted(): the elements are ints.

func (*List) Stream

func (l *List) Stream() *List

A Stream is the *List itself; every stage is eager and returns a new list.

func (*List) ToArray

func (l *List) ToArray() []any

ToArray is List.toArray(): a snapshot, also what a for-each over the list ranges over.

func (*List) ToList

func (l *List) ToList() *List

type ListenerList

type ListenerList struct {
	// contains filtered or unexported fields
}

ListenerList is org.eclipse.core.runtime.ListenerList: identity-compared, copy-on-write so GetListeners can be iterated while a listener removes itself.

func NewListenerList

func NewListenerList() *ListenerList

func (*ListenerList) Add

func (l *ListenerList) Add(x any)

func (*ListenerList) Clear

func (l *ListenerList) Clear()

func (*ListenerList) GetListeners

func (l *ListenerList) GetListeners() []any

func (*ListenerList) IsEmpty

func (l *ListenerList) IsEmpty() bool

func (*ListenerList) Remove

func (l *ListenerList) Remove(x any)

func (*ListenerList) Size

func (l *ListenerList) Size() int32

type Locale

type Locale struct {
	// contains filtered or unexported fields
}

Locale is java.util.Locale reduced to its toString() form; only ENGLISH is needed so far.

func LocaleDefault

func LocaleDefault() *Locale

func LocaleForLanguageTag

func LocaleForLanguageTag(tag string) *Locale

func (*Locale) GetCountry

func (l *Locale) GetCountry() string

func (*Locale) GetLanguage

func (l *Locale) GetLanguage() string

func (*Locale) GetVariant

func (l *Locale) GetVariant() string

func (*Locale) ToString

func (l *Locale) ToString() string

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map stands in for java.util.Map/HashMap: hashCode buckets with an equals scan, or plain Go equality for keys without HashCode/Equals.

func Environ

func Environ() *Map

Environ is System.getenv(): a snapshot of the process environment.

func NewMap

func NewMap() *Map

func (*Map) Clear

func (m *Map) Clear()

func (*Map) Compute

func (m *Map) Compute(k any, fn any) any

Compute is Map.compute(key, (k, old) -> new): a nil result removes the key.

func (*Map) ComputeIfAbsent

func (m *Map) ComputeIfAbsent(k any, fn any) any

ComputeIfAbsent is Map.computeIfAbsent: fn is a Go func of the key returning the value.

func (*Map) ContainsKey

func (m *Map) ContainsKey(k any) bool

func (*Map) EntrySet

func (m *Map) EntrySet() *List

EntrySet lists the entries by ascending int32 key: a HashMap of small Integer keys iterates in that order. Ceiling: other key types come out in an unspecified order.

func (*Map) ForEach

func (m *Map) ForEach(action any)

ForEach is Map.forEach(BiConsumer), same erased call as List.ForEach.

func (*Map) Get

func (m *Map) Get(k any) any

func (*Map) GetProperty

func (m *Map) GetProperty(key string) string

func (*Map) IsEmpty

func (m *Map) IsEmpty() bool

func (*Map) KeySet

func (m *Map) KeySet() *List

func (*Map) Load

func (m *Map) Load(in InputStream)

Properties (a Map): key=value lines in, sorted key=value lines out.

func (*Map) Put

func (m *Map) Put(k, v any) any

func (*Map) Remove

func (m *Map) Remove(k any) any

func (*Map) Size

func (m *Map) Size() int32

func (*Map) Store

func (m *Map) Store(out OutputStream, comments string)

func (*Map) Values

func (m *Map) Values() *List

Values is Map.values(): a snapshot in EntrySet order.

type MapEntry

type MapEntry struct {
	// contains filtered or unexported fields
}

MapEntry is Map.Entry.

func (*MapEntry) GetKey

func (e *MapEntry) GetKey() any

func (*MapEntry) GetValue

func (e *MapEntry) GetValue() any

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

func (*Matcher) End

func (m *Matcher) End() int32

func (*Matcher) Find

func (m *Matcher) Find() bool

func (*Matcher) Group

func (m *Matcher) Group(i ...int32) string

func (*Matcher) Start

func (m *Matcher) Start() int32

Start and End are UTF-16 offsets of the last match, as in Java. Ceiling: the regexp runs on bytes, so it can match inside a 3-byte WTF-8 unit; Start and End are exact only for valid text.

type MessageFormat

type MessageFormat struct{}

MessageFormat only names the static MessageFormatFormat (java.text.MessageFormat.format).

type Method

type Method struct {
	// contains filtered or unexported fields
}

Method is java.lang.reflect.Method, as returned by ClassGetMethod.

func ClassGetMethod

func ClassGetMethod(t reflect.Type, name string, paramTypes []reflect.Type) *Method

ClassGetMethod is java.lang.Class#getMethod(String, Class...): looks the Java method name up in t's own registered methods, then its ancestors' (Control, Widget, ...) by walking the same field-0 embedding chain Go itself promotes methods through (every translated class embeds its superclass at field 0 - see README "impl cascade"). Several registered entries can share javaName (Java overloads); the first whose paramTypes are all assignable from the requested ones wins - correct as long as at most one overload matches, same ceiling Java's own overload resolution would have on an ambiguous erasure.

func NewNamedMethod

func NewNamedMethod(name string) *Method

NewNamedMethod is a Method that only knows its name (TestInfo.getTestMethod).

func (*Method) GetName

func (mth *Method) GetName() string

func (*Method) GetReturnType

func (mth *Method) GetReturnType() reflect.Type

GetReturnType is Method.getReturnType(); nil (a nil reflect.Type) for a void method.

func (*Method) Invoke

func (mth *Method) Invoke(target any, args ...any) (result any)

Invoke is Method.invoke(target, args...). A failing call panics *InvocationTargetException with the real cause, matching the "exceptions are panics" contract the rest of jrt already uses (ParseInt, ResourceBundle, ...).

type MethodEntry

type MethodEntry struct {
	// contains filtered or unexported fields
}

MethodEntry is one registered method: paramTypes/returnType are its own Go types (for getMethod's overload matching and Method.getReturnType), call performs the actual dispatch.

type MissingResourceException

type MissingResourceException struct{ Key string }

MissingResourceException is java.util.MissingResourceException.

func (*MissingResourceException) Error

func (e *MissingResourceException) Error() string

type NoSuchElementException

type NoSuchElementException struct{}

NoSuchElementException is java.util.NoSuchElementException.

func (*NoSuchElementException) Error

func (e *NoSuchElementException) Error() string

type NoSuchFieldException

type NoSuchFieldException struct{ Message string }

NoSuchFieldException is java.lang.NoSuchFieldException.

func (*NoSuchFieldException) Error

func (e *NoSuchFieldException) Error() string

type NoSuchMethodException

type NoSuchMethodException struct{ Message string }

NoSuchMethodException is java.lang.NoSuchMethodException.

func (*NoSuchMethodException) Error

func (e *NoSuchMethodException) Error() string

type NullPointerException

type NullPointerException struct{ RuntimeException }

func NewNullPointerException

func NewNullPointerException(args ...any) *NullPointerException

type NullProgressMonitor

type NullProgressMonitor struct {
	// contains filtered or unexported fields
}

NullProgressMonitor ignores progress but remembers cancellation.

func NewNullProgressMonitor

func NewNullProgressMonitor() *NullProgressMonitor

func (*NullProgressMonitor) BeginTask

func (m *NullProgressMonitor) BeginTask(string, int32)

func (*NullProgressMonitor) Done

func (m *NullProgressMonitor) Done()

func (*NullProgressMonitor) InternalWorked

func (m *NullProgressMonitor) InternalWorked(float64)

func (*NullProgressMonitor) IsCanceled

func (m *NullProgressMonitor) IsCanceled() bool

func (*NullProgressMonitor) SetCanceled

func (m *NullProgressMonitor) SetCanceled(v bool)

func (*NullProgressMonitor) SetTaskName

func (m *NullProgressMonitor) SetTaskName(string)

func (*NullProgressMonitor) SubTask

func (m *NullProgressMonitor) SubTask(string)

func (*NullProgressMonitor) Worked

func (m *NullProgressMonitor) Worked(int32)

type NumberFormatException

type NumberFormatException struct{ Input string }

NumberFormatException is java.lang.NumberFormatException.

func (*NumberFormatException) Error

func (e *NumberFormatException) Error() string

type Optional

type Optional struct {
	// contains filtered or unexported fields
}

Optional is java.util.Optional over any: erased generics, so a caller casts Get's result.

func OptionalEmpty

func OptionalEmpty() *Optional

func OptionalOf

func OptionalOf(v any) *Optional

func OptionalOfNullable

func OptionalOfNullable(v any) *Optional

OptionalOfNullable: a nil interface or typed nil pointer is empty.

func (*Optional) Get

func (o *Optional) Get() any

func (*Optional) GetAsInt

func (o *Optional) GetAsInt() int32

GetAsInt is OptionalInt.getAsInt (an OptionalInt is an Optional of an int32).

func (*Optional) IsEmpty

func (o *Optional) IsEmpty() bool

func (*Optional) IsPresent

func (o *Optional) IsPresent() bool

func (*Optional) OrElse

func (o *Optional) OrElse(other any) any

func (*Optional) OrElseGet

func (o *Optional) OrElseGet(supplier any) any

OrElseGet is Optional.orElseGet: supplier is a Go func returning the value.

type OutputStream

type OutputStream interface {
	Write(b int32)
	WriteRange(b []int8, off, length int32)
	Flush()
	Close()
}

OutputStream mirrors write(int)/write(byte[],off,len)/flush()/close().

func NewOutputStream

func NewOutputStream(w io.Writer) OutputStream

NewOutputStream wraps a Go io.Writer as the OutputStream LEDataOutputStream/the format encoders write to.

type ParseException

type ParseException struct{ Message string }

func (*ParseException) Error

func (e *ParseException) Error() string

type Path

type Path struct {
	// contains filtered or unexported fields
}

Path is java.nio.file.Path as its string form. Options arguments (LinkOption, CopyOption, FileAttribute) arrive as an ignored []any: only the default behaviour is implemented.

func CreateTempDir

func CreateTempDir() *Path

CreateTempDir backs an @TempDir field; RemoveTempDir deletes it after the class.

func FilesCreateDirectories

func FilesCreateDirectories(p *Path, _ []any) *Path

func FilesCreateTempFile

func FilesCreateTempFile(prefix, suffix string, _ []any) *Path

FilesCreateTempFile is Files.createTempFile(prefix, suffix, attrs...).

func FilesReadSymbolicLink(p *Path) *Path

func PathOf

func PathOf(first string, more []string) *Path

func (*Path) Equals

func (p *Path) Equals(other *Path) bool

Equals is Path.equals.

func (*Path) GetFileName

func (p *Path) GetFileName() *Path

func (*Path) GetParent

func (p *Path) GetParent() *Path

func (*Path) Resolve

func (p *Path) Resolve(other any) *Path

func (*Path) String

func (p *Path) String() string

func (*Path) ToString

func (p *Path) ToString() string

func (*Path) ToUri

func (p *Path) ToUri() *URI

ToUri is Path.toUri(): an absolute file:// URI.

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

Pattern and Matcher are java.util.regex over Go's RE2 (no backreferences or lookaround).

func PatternCompile

func PatternCompile(regex string) *Pattern

\p{Punct} (Java) is [:punct:] inside a Go class.

func (*Pattern) Matcher

func (p *Pattern) Matcher(s string) *Matcher

type PrintStream

type PrintStream = io.Writer

PrintStream is java.io.PrintStream where a stream is only written to: System.out and System.err are *os.File, a constructed one is a *CapturedStream.

type ProgressMonitorWrapper

type ProgressMonitorWrapper struct{ IProgressMonitor }

ProgressMonitorWrapper forwards every call to the wrapped monitor.

func NewProgressMonitorWrapper

func NewProgressMonitorWrapper(m IProgressMonitor) *ProgressMonitorWrapper

func (*ProgressMonitorWrapper) GetWrappedProgressMonitor

func (w *ProgressMonitorWrapper) GetWrappedProgressMonitor() IProgressMonitor

type Random

type Random struct {
	// contains filtered or unexported fields
}

Random is java.util.Random's 48-bit LCG, so a fixed seed gives Java's sequence.

func NewRandom

func NewRandom(seed ...int64) *Random

func (*Random) NextBytes

func (r *Random) NextBytes(bytes []int8)

NextBytes fills bytes like java.util.Random.nextBytes.

func (*Random) NextInt

func (r *Random) NextInt(bound ...int32) int32

NextInt covers nextInt() and nextInt(bound).

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader stands for BufferedReader, InputStreamReader and FileReader alike.

func NewBufferedReader

func NewBufferedReader(r any) *Reader

func NewFileReader

func NewFileReader(file any) *Reader

func NewInputStreamReader

func NewInputStreamReader(in InputStream) *Reader

func (*Reader) Close

func (r *Reader) Close()

func (*Reader) Lines

func (r *Reader) Lines() *List

Lines is BufferedReader.lines(): a stream is an eager *List here.

func (*Reader) ReadLine

func (r *Reader) ReadLine() string

ReadLine is BufferedReader.readLine(): the next line, "" at the end (Java's null).

type RejectedExecutionException

type RejectedExecutionException struct{ RuntimeException }

func NewRejectedExecutionException

func NewRejectedExecutionException(args ...any) *RejectedExecutionException

type ResourceBundle

type ResourceBundle struct {
	// contains filtered or unexported fields
}

ResourceBundle is java.util.ResourceBundle backed by a <name>.properties file in the registered resource FS (RegisterResources). No locale fallback chain: only the base bundle is read.

func ResourceBundleGetBundle

func ResourceBundleGetBundle(name string) *ResourceBundle

Read on first GetString: a package var initializer may run before the embedding package registers its FS.

func (*ResourceBundle) GetString

func (b *ResourceBundle) GetString(key string) string

type Runnable

type Runnable interface {
	Run()
}

Runnable is java.lang.Runnable. Lambdas and anonymous classes become *RunnableFunc: a pointer, so two runnables compare by identity (Display.timerExec looks a runnable up with ==).

type RunnableFunc

type RunnableFunc struct {
	Fn func()
}

func NewRunnable

func NewRunnable(fn func()) *RunnableFunc

func (*RunnableFunc) Run

func (r *RunnableFunc) Run()

type RuntimeException

type RuntimeException struct {
	Message string
	Cause   error
}

RuntimeException and JavaError carry their own Message/Cause instead of sharing an embedded Throwable - see README "Manual superclass embedding" for why, and the ceiling this leaves.

func NewRuntimeException

func NewRuntimeException(message string) RuntimeException

func (*RuntimeException) Error

func (e *RuntimeException) Error() string

func (*RuntimeException) GetMessage

func (e *RuntimeException) GetMessage() string

func (*RuntimeException) PrintStackTrace

func (e *RuntimeException) PrintStackTrace()

func (*RuntimeException) Unwrap

func (e *RuntimeException) Unwrap() error

type SimpleDateFormat

type SimpleDateFormat = DateFormat

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Stack is java.util.Stack.

func NewStack

func NewStack() *Stack

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

func (*Stack) Pop

func (s *Stack) Pop() any

func (*Stack) Push

func (s *Stack) Push(v any) any

type Status

type Status struct {
	Severity  int32
	Plugin    string
	Code      int32
	Message   string
	Exception error
}

func NewStatus

func NewStatus(severity int32, plugin string, message string, exception ...error) *Status

func (*Status) GetCode

func (s *Status) GetCode() int32

func (*Status) GetException

func (s *Status) GetException() error

func (*Status) GetMessage

func (s *Status) GetMessage() string

func (*Status) GetPlugin

func (s *Status) GetPlugin() string

func (*Status) GetSeverity

func (s *Status) GetSeverity() int32

func (*Status) IsOK

func (s *Status) IsOK() bool

type StringBuilder

type StringBuilder struct {
	// contains filtered or unexported fields
}

StringBuilder is java.lang.StringBuilder. It holds UTF-16 units, so indices and Length match Java.

func NewStringBuilder

func NewStringBuilder(init ...any) *StringBuilder

NewStringBuilder covers (), (int capacity) and (String).

func (*StringBuilder) Append

func (s *StringBuilder) Append(v any, offsetLen ...int32) *StringBuilder

Append covers append(x) and append(char[], offset, len).

func (*StringBuilder) CharAt

func (s *StringBuilder) CharAt(i int32) uint16

func (*StringBuilder) Delete

func (s *StringBuilder) Delete(start, end int32) *StringBuilder

func (*StringBuilder) DeleteCharAt

func (s *StringBuilder) DeleteCharAt(i int32) *StringBuilder

func (*StringBuilder) GetChars

func (s *StringBuilder) GetChars(srcBegin, srcEnd int32, dst []uint16, dstBegin int32)

GetChars is getChars(srcBegin, srcEnd, dst, dstBegin).

func (*StringBuilder) IndexOf

func (s *StringBuilder) IndexOf(sub string) int32

func (*StringBuilder) Insert

func (s *StringBuilder) Insert(at int32, v any) *StringBuilder

func (*StringBuilder) IsEmpty

func (s *StringBuilder) IsEmpty() bool

func (*StringBuilder) Length

func (s *StringBuilder) Length() int32

func (*StringBuilder) Replace

func (sb *StringBuilder) Replace(start, end int32, s string) *StringBuilder

func (*StringBuilder) SetLength

func (s *StringBuilder) SetLength(n int32)

func (*StringBuilder) String

func (s *StringBuilder) String() string

func (*StringBuilder) ToString

func (s *StringBuilder) ToString() string

type StringTokenizer

type StringTokenizer struct {
	// contains filtered or unexported fields
}

StringTokenizer is java.util.StringTokenizer over a set of delimiter characters.

func NewStringTokenizer

func NewStringTokenizer(s string, delim ...string) *StringTokenizer

func (*StringTokenizer) HasMoreTokens

func (t *StringTokenizer) HasMoreTokens() bool

func (*StringTokenizer) NextToken

func (t *StringTokenizer) NextToken() string

type Thread

type Thread struct {
	// contains filtered or unexported fields
}

Thread is java.lang.Thread for `new Thread(runnable)` + start/join; the port's `Thread` type itself stays a bare any (Display.thread), see Manual.

func NewThread

func NewThread(r Runnable) *Thread

func (*Thread) Run

func (t *Thread) Run()

Run lets a Thread be passed as a Runnable; it runs the body in place.

type TimeUnit

type TimeUnit int32

TimeUnit is java.util.concurrent.TimeUnit; only the units below are modeled.

const (
	TimeUnitMILLISECONDS TimeUnit = iota
	TimeUnitSECONDS
	TimeUnitNANOSECONDS
)

type TimeoutException

type TimeoutException struct{ RuntimeException }

func NewTimeoutException

func NewTimeoutException(args ...any) *TimeoutException

type TreeSet

type TreeSet struct{ *List }

TreeSet is a sorted set of int32 or string elements (Image.ImageHandleManager's zoom set).

func NewTreeSet

func NewTreeSet(from ...any) *TreeSet

func (*TreeSet) Add

func (t *TreeSet) Add(a ...any) bool

func (*TreeSet) AddAll

func (t *TreeSet) AddAll(other *List) bool

func (*TreeSet) Higher

func (t *TreeSet) Higher(v any) any

Higher is the least element strictly greater than v, nil if none.

func (*TreeSet) Lower

func (t *TreeSet) Lower(v any) any

Lower is the greatest element strictly less than v, nil if none.

type URI

type URI struct {
	// contains filtered or unexported fields
}

URI is java.net.URI as its string form (Path.toUri().toString()).

func NewURI

func NewURI(s string) *URI

NewURI parses s like new URI(String): an unparsable string throws URISyntaxException.

func (*URI) GetQuery

func (u *URI) GetQuery() string

GetQuery is URI.getQuery(): the raw-decoded query, null (the empty string here) without one.

func (*URI) GetScheme

func (u *URI) GetScheme() string

GetScheme is URI.getScheme(): the text before the first colon when it is a valid scheme, else the port's null String.

func (*URI) String

func (u *URI) String() string

func (*URI) ToString

func (u *URI) ToString() string

type URISyntaxException

type URISyntaxException struct{ RuntimeException }

URISyntaxException is new URISyntaxException(input, reason).

func NewURISyntaxException

func NewURISyntaxException(input, reason string) *URISyntaxException

type WeakReference

type WeakReference struct {
	// contains filtered or unexported fields
}

WeakReference is java.lang.ref.WeakReference over a pointer boxed in any.

func NewWeakReference

func NewWeakReference(v any) *WeakReference

func (*WeakReference) Get

func (w *WeakReference) Get() any

Get is nil once the referent is collected; the caller casts the result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL