|
@@ -4,41 +4,39 @@
|
|
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
|
*/
|
|
|
|
|
|
-import SortedArray from '../../mol-base/collections/integer/sorted-array'
|
|
|
-import OrderedSet from '../../mol-base/collections/integer/ordered-set'
|
|
|
-import Iterator from '../../mol-base/collections/iterator'
|
|
|
-import Atom from './atom'
|
|
|
-import * as Base from './atom-set/base'
|
|
|
-import createBuilder from './atom-set/builder'
|
|
|
+import { OrderedSet, SortedArray, Iterator } from '../../../mol-base/collections/integer'
|
|
|
+import Atom from '../atom'
|
|
|
+import * as Impl from './set/impl'
|
|
|
+import createBuilder from './set/builder'
|
|
|
|
|
|
/** A map-like representation of grouped atom set */
|
|
|
namespace AtomSet {
|
|
|
- export const Empty: AtomSet = Base.Empty as any;
|
|
|
+ export const Empty: AtomSet = Impl.Empty as any;
|
|
|
|
|
|
- export const create: (data: Atom | ArrayLike<Atom> | { [unitId: number]: OrderedSet }) => AtomSet = Base.create as any;
|
|
|
+ export const create: (data: Atom | ArrayLike<Atom> | { [unitId: number]: OrderedSet }) => AtomSet = Impl.create as any;
|
|
|
|
|
|
- export const unitCount: (set: AtomSet) => number = Base.keyCount as any;
|
|
|
- export const unitIds: (set: AtomSet) => SortedArray = Base.getKeys as any;
|
|
|
- export const unitHas: (set: AtomSet, id: number) => boolean = Base.hasKey as any;
|
|
|
- export const unitGetId: (set: AtomSet, i: number) => number = Base.getKey as any;
|
|
|
+ export const unitCount: (set: AtomSet) => number = Impl.keyCount as any;
|
|
|
+ export const unitIds: (set: AtomSet) => SortedArray = Impl.getKeys as any;
|
|
|
+ export const unitHas: (set: AtomSet, id: number) => boolean = Impl.hasKey as any;
|
|
|
+ export const unitGetId: (set: AtomSet, i: number) => number = Impl.getKey as any;
|
|
|
|
|
|
- export const unitGetById: (set: AtomSet, key: number) => OrderedSet = Base.getByKey as any;
|
|
|
- export const unitGetByIndex: (set: AtomSet, i: number) => OrderedSet = Base.getByIndex as any;
|
|
|
+ export const unitGetById: (set: AtomSet, key: number) => OrderedSet = Impl.getByKey as any;
|
|
|
+ export const unitGetByIndex: (set: AtomSet, i: number) => OrderedSet = Impl.getByIndex as any;
|
|
|
|
|
|
- export const atomCount: (set: AtomSet) => number = Base.size as any;
|
|
|
- export const atomHas: (set: AtomSet, x: Atom) => boolean = Base.hasAtom as any;
|
|
|
- export const atomIndexOf: (set: AtomSet, x: Atom) => number = Base.indexOf as any;
|
|
|
- export const atomGetAt: (set: AtomSet, i: number) => Atom = Base.getAt as any;
|
|
|
- export const atoms: (set: AtomSet) => Iterator<Atom> = Base.values as any;
|
|
|
+ export const atomCount: (set: AtomSet) => number = Impl.size as any;
|
|
|
+ export const atomHas: (set: AtomSet, x: Atom) => boolean = Impl.hasAtom as any;
|
|
|
+ export const atomIndexOf: (set: AtomSet, x: Atom) => number = Impl.indexOf as any;
|
|
|
+ export const atomGetAt: (set: AtomSet, i: number) => Atom = Impl.getAt as any;
|
|
|
+ export const atoms: (set: AtomSet) => Iterator<Atom> = Impl.values as any;
|
|
|
|
|
|
- export const hashCode: (set: AtomSet) => number = Base.hashCode as any;
|
|
|
- export const areEqual: (a: AtomSet, b: AtomSet) => boolean = Base.areEqual as any;
|
|
|
- export const areIntersecting: (a: AtomSet, b: AtomSet) => boolean = Base.areIntersecting as any;
|
|
|
+ export const hashCode: (set: AtomSet) => number = Impl.hashCode as any;
|
|
|
+ export const areEqual: (a: AtomSet, b: AtomSet) => boolean = Impl.areEqual as any;
|
|
|
+ export const areIntersecting: (a: AtomSet, b: AtomSet) => boolean = Impl.areIntersecting as any;
|
|
|
|
|
|
- export const union: (a: AtomSet, b: AtomSet) => AtomSet = Base.union as any;
|
|
|
- export const unionMany: (sets: AtomSet[]) => AtomSet = Base.unionMany as any;
|
|
|
- export const intersect: (a: AtomSet, b: AtomSet) => AtomSet = Base.intersect as any;
|
|
|
- export const subtract: (a: AtomSet, b: AtomSet) => AtomSet = Base.subtract as any;
|
|
|
+ export const union: (a: AtomSet, b: AtomSet) => AtomSet = Impl.union as any;
|
|
|
+ export const unionMany: (sets: AtomSet[]) => AtomSet = Impl.unionMany as any;
|
|
|
+ export const intersect: (a: AtomSet, b: AtomSet) => AtomSet = Impl.intersect as any;
|
|
|
+ export const subtract: (a: AtomSet, b: AtomSet) => AtomSet = Impl.subtract as any;
|
|
|
|
|
|
export function SortedBuilder(parent: AtomSet) { return createBuilder(parent, true); }
|
|
|
export function Builder(parent: AtomSet) { return createBuilder(parent, false); }
|