mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-01 14:29:33 +01:00
o sets of enums are handled as JUEnumSet instances, others as JUBitSet
derivatives (both smallsets and varsets, to make interoperability with
Java easier)
o special handling of set constants: these have to be constructed at run
time. In case of constants in the code, create an internal constsym to
represent them. These and regular constsyms are then aliased by an
another internal staticvarsym that is used to initialise them in the
unit initialisation code.
o until they are constructed at run time, set constants are encoded as
constant Java strings (with the characters containing the set bits)
o hlcgobj conversion of tcginnode.pass_generate_code() for the genjumps
part (that's the only part of the generic code that's used by the JVM
target)
o as far as explicit typecasting support is concerned, currently the
following ones are supported (both from/to setdefs): ordinal types,
enums, any other set types (whose size is the same on native targets)
o enum setdefs also emit signatures
o overloading routines for different ordinal set types, or for different
enum set types, is not supported on the JVM target
git-svn-id: branches/jvmbackend@18662 -
34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
{
|
|
This file is part of the Free Pascal run time library.
|
|
Copyright (c) 2011 by Jonas Maebe,
|
|
members of the Free Pascal development team.
|
|
|
|
This file declares support infrastructure for sets under the JVM
|
|
|
|
See the file COPYING.FPC, included in this distribution,
|
|
for details about the copyright.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
**********************************************************************}
|
|
|
|
type
|
|
{ Adds support for a "base" value that is used as lower bound for the set's
|
|
contents }
|
|
|
|
FpcBitSet = class sealed (JUBitSet)
|
|
function add(elem: jint): FpcBitSet;
|
|
function addAll(s: FpcBitSet): FpcBitSet;
|
|
function remove(elem: jint): FpcBitSet;
|
|
function removeAll(s: FpcBitSet): FpcBitSet;
|
|
function retainAll(s: FpcBitSet): FpcBitSet;
|
|
function contains(elem: jint): boolean;
|
|
function containsAll(s: FpcBitSet): boolean;
|
|
function symdif(s: FpcBitSet): FpcBitSet;
|
|
class function range(start, stop: jint): FpcBitSet; static;
|
|
class function &of(elem: jint): FpcBitSet; static;
|
|
end;
|
|
|