index int64 | repo_id string | file_path string | content string |
|---|---|---|---|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostField.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamically typed field descriptor for a host type.
*/
public interface HostField<T> extends HostMember<T> {
Object get(Bridge bridge, T self);
default void set(Bridge bridge, T self, Object value) {
throw new UnsupportedOperationException();
}
default boolean remove(Bridge bridge, T self) {
throw new UnsupportedOperationException();
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostFunction.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A host object that has a dynamic function type descriptor.
*/
public interface HostFunction extends HostValue {
HostFunctionType<? extends Object> dynamicType();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostFunctionType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamic function type descriptor for a host type.
*/
public interface HostFunctionType<T> extends HostType<T> {
Object execute(Bridge bridge, T self, Object... arguments);
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostLibrary.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
/**
* A collection of dynamically typed module descriptors representing
* a host library.
*/
public interface HostLibrary {
String libraryName();
HostPackage getHostPackage(String packageName);
Collection<HostPackage> hostPackages();
HostType<?> getHostType(String typeName);
HostType<?> getHostType(Class<?> typeClass);
Collection<HostType<?>> hostTypes();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostMember.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamically typed member descriptor for a host type.
*/
public interface HostMember<T> {
String key();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostMethod.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamically typed method descriptor for a host type.
*/
public interface HostMethod<T> extends HostMember<T> {
Object invoke(Bridge bridge, T self, Object... arguments);
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostObject.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A host object that has a dynamic object type descriptor.
*/
public interface HostObject extends HostValue {
HostObjectType<? extends Object> dynamicType();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostObjectType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
/**
* A dynamic object type descriptor for a host type.
*/
public interface HostObjectType<T> extends HostType<T> {
HostMember<? super T> getOwnMember(Bridge bridge, T self, String key);
Collection<HostMember<? super T>> ownMembers(Bridge bridge, T self);
HostMember<? super T> getMember(Bridge bridge, T self, String key);
Collection<HostMember<? super T>> members(Bridge bridge, T self);
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostPackage.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
/**
* A collection of dynamic type descriptors representing a host package.
*/
public interface HostPackage {
String packageName();
HostType<?> getHostType(String typeName);
HostType<?> getHostType(Class<?> typeClass);
Collection<HostType<?>> hostTypes();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostRuntime.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
/**
* A collection of dynamically typed library descriptors representing
* a host runtime.
*/
public interface HostRuntime {
HostLibrary getHostLibrary(String libraryName);
Collection<HostLibrary> hostLibraries();
HostPackage getHostPackage(String packageName);
Collection<HostPackage> hostPackages();
HostType<?> getHostType(Class<?> typeClass);
Collection<HostType<?>> hostTypes();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostStaticField.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamically typed static field descriptor for a host type.
*/
public interface HostStaticField extends HostStaticMember {
Object get(Bridge bridge);
default void set(Bridge bridge, Object value) {
throw new UnsupportedOperationException();
}
default boolean remove(Bridge bridge) {
throw new UnsupportedOperationException();
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostStaticMember.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamically typed static member descriptor for a host type.
*/
public interface HostStaticMember {
String key();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostStaticMethod.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A dynamically typed static method descriptor for a host type.
*/
public interface HostStaticMethod extends HostStaticMember {
Object invoke(Bridge bridge, Object... arguments);
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
import java.util.List;
/**
* A dynamic type descriptor for a host type.
*/
public interface HostType<T> {
String typeName();
Class<?> hostClass();
boolean isBuiltin();
HostType<? super T> superType();
List<HostType<? super T>> baseTypes();
boolean inheritsType(HostType<?> superType);
HostStaticMember getOwnStaticMember(Bridge bridge, String key);
Collection<HostStaticMember> ownStaticMembers(Bridge bridge);
HostStaticMember getStaticMember(Bridge bridge, String key);
Collection<HostStaticMember> staticMembers(Bridge bridge);
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/HostValue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
/**
* A host object that has a dynamic type descriptor.
*/
public interface HostValue {
HostType<? extends Object> dynamicType();
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/JavaHostBuiltinType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
public class JavaHostBuiltinType<T> extends JavaHostObjectType<T> {
public JavaHostBuiltinType(Class<?> hostClass) {
super(hostClass);
}
@Override
public boolean isBuiltin() {
return true;
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/JavaHostClassType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
public class JavaHostClassType<T> extends JavaHostObjectType<T> implements HostClassType<T> {
HostConstructor constructor;
public JavaHostClassType(Class<?> hostClass) {
super(hostClass);
this.constructor = null;
}
@Override
public final HostConstructor constructor(Bridge bridge) {
return this.constructor;
}
public void setConstructor(HostConstructor constructor) {
this.constructor = constructor;
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/JavaHostLibrary.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
import swim.collections.HashTrieMap;
public class JavaHostLibrary implements HostLibrary {
protected final String libraryName;
HashTrieMap<String, HostPackage> hostPackages;
HashTrieMap<String, HostType<?>> hostTypeNames;
HashTrieMap<Class<?>, HostType<?>> hostTypeClasses;
public JavaHostLibrary(String libraryName) {
this.libraryName = libraryName;
this.hostPackages = HashTrieMap.empty();
this.hostTypeNames = HashTrieMap.empty();
this.hostTypeClasses = HashTrieMap.empty();
}
@Override
public final String libraryName() {
return this.libraryName;
}
@Override
public final HostPackage getHostPackage(String packageName) {
return this.hostPackages.get(packageName);
}
@Override
public final Collection<HostPackage> hostPackages() {
return this.hostPackages.values();
}
@Override
public final HostType<?> getHostType(String typeName) {
return this.hostTypeNames.get(typeName);
}
@Override
public final HostType<?> getHostType(Class<?> typeClass) {
return this.hostTypeClasses.get(typeClass);
}
@Override
public Collection<HostType<?>> hostTypes() {
return this.hostTypeClasses.values();
}
public void addHostPackage(HostPackage hostPackage) {
final String packageName = hostPackage.packageName();
if (!this.hostPackages.containsKey(packageName)) {
this.hostPackages = this.hostPackages.updated(packageName, hostPackage);
for (HostType<?> hostType : hostPackage.hostTypes()) {
addHostType(hostType);
}
}
}
public void addHostType(HostType<?> hostType) {
this.hostTypeNames = this.hostTypeNames.updated(hostType.typeName(), hostType);
this.hostTypeClasses = this.hostTypeClasses.updated(hostType.hostClass(), hostType);
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/JavaHostObjectType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
import java.util.List;
import swim.collections.FingerTrieSeq;
import swim.collections.HashTrieMap;
public class JavaHostObjectType<T> extends AbstractHostObjectType<T> {
protected final Class<?> hostClass;
HostType<? super T> superType;
FingerTrieSeq<HostType<? super T>> baseTypes;
HashTrieMap<String, HostMember<? super T>> ownMembers;
HashTrieMap<String, HostStaticMember> ownStaticMembers;
public JavaHostObjectType(Class<?> hostClass) {
this.hostClass = hostClass;
this.superType = null;
this.baseTypes = FingerTrieSeq.empty();
this.ownMembers = HashTrieMap.empty();
this.ownStaticMembers = HashTrieMap.empty();
}
@Override
public final Class<?> hostClass() {
return this.hostClass;
}
@Override
public final HostType<? super T> superType() {
return this.superType;
}
@Override
public final List<HostType<? super T>> baseTypes() {
return this.baseTypes;
}
@Override
public final HostMember<? super T> getOwnMember(Bridge bridge, T self, String key) {
return this.ownMembers.get(key);
}
@Override
public final Collection<HostMember<? super T>> ownMembers(Bridge bridge, T self) {
return this.ownMembers.values();
}
@Override
public final HostStaticMember getOwnStaticMember(Bridge bridge, String key) {
return this.ownStaticMembers.get(key);
}
@Override
public final Collection<HostStaticMember> ownStaticMembers(Bridge bridge) {
return this.ownStaticMembers.values();
}
@SuppressWarnings("unchecked")
public void extendType(HostType<?> superType) {
if (this.superType != null) {
throw new BridgeException();
} else if (!this.baseTypes.isEmpty()) {
throw new BridgeException();
}
this.superType = (HostType<? super T>) superType;
this.baseTypes = FingerTrieSeq.from((List<HostType<? super T>>) (List<?>) superType.baseTypes())
.appended((HostType<? super T>) superType);
}
@SuppressWarnings("unchecked")
public void inheritType(HostType<?> superType) {
if (!inheritsType(superType)) {
for (HostType<?> baseType : superType.baseTypes()) {
if (!inheritsType(baseType)) {
this.baseTypes = this.baseTypes.appended((HostType<? super T>) baseType);
}
}
this.baseTypes = this.baseTypes.appended((HostType<? super T>) superType);
}
}
public void addMember(HostMember<? super T> member) {
this.ownMembers = this.ownMembers.updated(member.key(), member);
}
public void addStaticMember(HostStaticMember staticMember) {
this.ownStaticMembers = this.ownStaticMembers.updated(staticMember.key(), staticMember);
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/JavaHostPackage.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
import swim.collections.HashTrieMap;
public class JavaHostPackage implements HostPackage {
protected final String packageName;
HashTrieMap<String, HostType<?>> hostTypeNames;
HashTrieMap<Class<?>, HostType<?>> hostTypeClasses;
public JavaHostPackage(String packageName) {
this.packageName = packageName;
this.hostTypeNames = HashTrieMap.empty();
this.hostTypeClasses = HashTrieMap.empty();
}
@Override
public final String packageName() {
return this.packageName;
}
@Override
public final HostType<?> getHostType(String typeName) {
return this.hostTypeNames.get(typeName);
}
@Override
public final HostType<?> getHostType(Class<?> typeClass) {
return this.hostTypeClasses.get(typeClass);
}
@Override
public final Collection<HostType<?>> hostTypes() {
return this.hostTypeClasses.values();
}
public void addHostType(HostType<?> hostType) {
this.hostTypeNames = this.hostTypeNames.updated(hostType.typeName(), hostType);
this.hostTypeClasses = this.hostTypeClasses.updated(hostType.hostClass(), hostType);
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/JavaHostRuntime.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
import swim.collections.HashTrieMap;
public class JavaHostRuntime implements HostRuntime {
HashTrieMap<String, HostLibrary> hostLibraries;
HashTrieMap<String, HostPackage> hostPackages;
HashTrieMap<Class<?>, HostType<?>> hostTypes;
public JavaHostRuntime() {
this.hostLibraries = HashTrieMap.empty();
this.hostPackages = HashTrieMap.empty();
this.hostTypes = HashTrieMap.empty();
}
@Override
public final HostLibrary getHostLibrary(String libraryName) {
return this.hostLibraries.get(libraryName);
}
@Override
public final Collection<HostLibrary> hostLibraries() {
return this.hostLibraries.values();
}
@Override
public final HostPackage getHostPackage(String packageName) {
return this.hostPackages.get(packageName);
}
@Override
public final Collection<HostPackage> hostPackages() {
return this.hostPackages.values();
}
@Override
public final HostType<?> getHostType(Class<?> typeClass) {
return this.hostTypes.get(typeClass);
}
@Override
public final Collection<HostType<?>> hostTypes() {
return this.hostTypes.values();
}
public void addHostLibrary(HostLibrary hostLibrary) {
final String libraryName = hostLibrary.libraryName();
if (!this.hostLibraries.containsKey(libraryName)) {
this.hostLibraries = this.hostLibraries.updated(libraryName, hostLibrary);
for (HostPackage hostPackage : hostLibrary.hostPackages()) {
addHostPackage(hostPackage);
}
}
}
public void addHostPackage(HostPackage hostPackage) {
final String packageName = hostPackage.packageName();
if (!this.hostPackages.containsKey(packageName)) {
this.hostPackages = this.hostPackages.updated(packageName, hostPackage);
for (HostType<?> hostType : hostPackage.hostTypes()) {
addHostType(hostType);
}
}
}
public void addHostType(HostType<?> hostType) {
this.hostTypes = this.hostTypes.updated(hostType.hostClass(), hostType);
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/PolyglotHostObjectType.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic;
import java.util.Collection;
import java.util.List;
import swim.collections.FingerTrieSeq;
import swim.collections.HashTrieMap;
/**
* A dynamic object type descriptor that has specialized members for specific
* guest languages.
*/
public class PolyglotHostObjectType<T> extends AbstractHostObjectType<T> {
protected final Class<?> hostClass;
HostType<? super T> superType;
FingerTrieSeq<HostType<? super T>> baseTypes;
HashTrieMap<String, HostMember<? super T>> ownMembers;
HashTrieMap<String, HostStaticMember> ownStaticMembers;
HashTrieMap<String, PolyglotObjectTypeSpecialization<T>> specializations;
PolyglotObjectTypeSpecialization<T> unspecialized;
public PolyglotHostObjectType(Class<?> hostClass) {
this.hostClass = hostClass;
this.superType = null;
this.baseTypes = FingerTrieSeq.empty();
this.ownMembers = HashTrieMap.empty();
this.ownStaticMembers = HashTrieMap.empty();
this.specializations = HashTrieMap.empty();
this.unspecialized = null;
}
@Override
public final Class<?> hostClass() {
return this.hostClass;
}
@Override
public boolean isBuiltin() {
return false;
}
@Override
public final HostType<? super T> superType() {
return this.superType;
}
@Override
public final List<HostType<? super T>> baseTypes() {
return this.baseTypes;
}
@Override
public HostMember<? super T> getOwnMember(Bridge bridge, T self, String key) {
HostMember<? super T> member;
final PolyglotObjectTypeSpecialization<T> specialized = this.specializations.get(bridge.guestLanguage());
if (specialized != null) {
member = specialized.ownMembers.get(key);
} else {
final PolyglotObjectTypeSpecialization<T> unspecialized = this.unspecialized;
member = unspecialized != null ? unspecialized.ownMembers.get(key) : null;
}
if (member == null) {
member = this.ownMembers.get(key);
}
return member;
}
@Override
public Collection<HostMember<? super T>> ownMembers(Bridge bridge, T self) {
HashTrieMap<String, HostMember<? super T>> ownMembers = this.ownMembers;
final PolyglotObjectTypeSpecialization<T> specialized = this.specializations.get(bridge.guestLanguage());
if (specialized != null) {
if (!specialized.ownMembers.isEmpty()) {
ownMembers = ownMembers.updated(specialized.ownMembers);
}
} else {
final PolyglotObjectTypeSpecialization<T> unspecialized = this.unspecialized;
if (unspecialized != null && !unspecialized.ownMembers.isEmpty()) {
ownMembers = ownMembers.updated(unspecialized.ownMembers);
}
}
return ownMembers.values();
}
@Override
public HostStaticMember getOwnStaticMember(Bridge bridge, String key) {
HostStaticMember staticMember;
final PolyglotObjectTypeSpecialization<T> specialized = this.specializations.get(bridge.guestLanguage());
if (specialized != null) {
staticMember = specialized.ownStaticMembers.get(key);
} else {
final PolyglotObjectTypeSpecialization<T> unspecialized = this.unspecialized;
staticMember = unspecialized != null ? unspecialized.ownStaticMembers.get(key) : null;
}
if (staticMember == null) {
staticMember = this.ownStaticMembers.get(key);
}
return staticMember;
}
@Override
public Collection<HostStaticMember> ownStaticMembers(Bridge bridge) {
HashTrieMap<String, HostStaticMember> ownStaticMembers = this.ownStaticMembers;
final PolyglotObjectTypeSpecialization<T> specialized = this.specializations.get(bridge.guestLanguage());
if (specialized != null) {
if (!specialized.ownStaticMembers.isEmpty()) {
ownStaticMembers = ownStaticMembers.updated(specialized.ownStaticMembers);
}
} else {
final PolyglotObjectTypeSpecialization<T> unspecialized = this.unspecialized;
if (unspecialized != null && !unspecialized.ownMembers.isEmpty()) {
ownStaticMembers = ownStaticMembers.updated(unspecialized.ownStaticMembers);
}
}
return ownStaticMembers.values();
}
@SuppressWarnings("unchecked")
public void extendType(HostType<?> superType) {
if (this.superType != null) {
throw new BridgeException();
} else if (!this.baseTypes.isEmpty()) {
throw new BridgeException();
}
this.superType = (HostType<? super T>) superType;
this.baseTypes = FingerTrieSeq.from((List<HostType<? super T>>) (List<?>) superType.baseTypes())
.appended((HostType<? super T>) superType);
}
@SuppressWarnings("unchecked")
public void inheritType(HostType<?> superType) {
if (!inheritsType(superType)) {
for (HostType<?> baseType : superType.baseTypes()) {
if (!inheritsType(baseType)) {
this.baseTypes = this.baseTypes.appended((HostType<? super T>) baseType);
}
}
this.baseTypes = this.baseTypes.appended((HostType<? super T>) superType);
}
}
public void addMember(HostMember<? super T> member) {
this.ownMembers = this.ownMembers.updated(member.key(), member);
}
public void addStaticMember(HostStaticMember staticMember) {
this.ownStaticMembers = this.ownStaticMembers.updated(staticMember.key(), staticMember);
}
public void addSpecializedMember(String language, HostMember<? super T> member) {
PolyglotObjectTypeSpecialization<T> specialized = this.specializations.get(language);
if (specialized == null) {
specialized = new PolyglotObjectTypeSpecialization<T>();
this.specializations = this.specializations.updated(language, specialized);
}
specialized.addMember(member);
}
public void addSpecializedStaticMember(String language, HostStaticMember staticMember) {
PolyglotObjectTypeSpecialization<T> specialized = this.specializations.get(language);
if (specialized == null) {
specialized = new PolyglotObjectTypeSpecialization<T>();
this.specializations = this.specializations.updated(language, specialized);
}
specialized.addStaticMember(staticMember);
}
public void addUnspecializedMember(HostMember<? super T> member) {
PolyglotObjectTypeSpecialization<T> unspecialized = this.unspecialized;
if (unspecialized == null) {
unspecialized = new PolyglotObjectTypeSpecialization<T>();
this.unspecialized = unspecialized;
}
unspecialized.addMember(member);
}
public void addUnspecializedStaticMember(HostStaticMember staticMember) {
PolyglotObjectTypeSpecialization<T> unspecialized = this.unspecialized;
if (unspecialized == null) {
unspecialized = new PolyglotObjectTypeSpecialization<T>();
this.unspecialized = unspecialized;
}
unspecialized.addStaticMember(staticMember);
}
}
final class PolyglotObjectTypeSpecialization<T> {
HashTrieMap<String, HostMember<? super T>> ownMembers;
HashTrieMap<String, HostStaticMember> ownStaticMembers;
PolyglotObjectTypeSpecialization() {
this.ownMembers = HashTrieMap.empty();
this.ownStaticMembers = HashTrieMap.empty();
}
void addMember(HostMember<? super T> member) {
this.ownMembers = this.ownMembers.updated(member.key(), member);
}
void addStaticMember(HostStaticMember staticMember) {
this.ownStaticMembers = this.ownStaticMembers.updated(staticMember.key(), staticMember);
}
}
|
0 | java-sources/ai/swim/swim-dynamic/3.10.0/swim | java-sources/ai/swim/swim-dynamic/3.10.0/swim/dynamic/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Language binding interfaces.
*/
package swim.dynamic;
|
0 | java-sources/ai/swim/swim-dynamic-api | java-sources/ai/swim/swim-dynamic-api/3.10.0/module-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api dynamic language bindings.
*/
module swim.dynamic.api {
requires transitive swim.api;
requires transitive swim.dynamic;
requires transitive swim.dynamic.java;
requires transitive swim.dynamic.observable;
exports swim.dynamic.api;
exports swim.dynamic.api.agent;
exports swim.dynamic.api.function;
exports swim.dynamic.api.lane;
exports swim.dynamic.api.lane.function;
exports swim.dynamic.api.plane;
exports swim.dynamic.api.warp;
exports swim.dynamic.api.warp.function;
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/HostLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api;
import swim.api.Lane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostLane {
private HostLane() {
// static
}
public static final HostObjectType<Lane> TYPE;
static {
final JavaHostObjectType<Lane> type = new JavaHostObjectType<>(Lane.class);
TYPE = type;
type.inheritType(HostObject.TYPE); // FIXME: replace with type.inheritType(HostLog.TYPE);
type.addMember(new HostLaneHostUri());
type.addMember(new HostLaneNodeUri());
type.addMember(new HostLaneLaneUri());
type.addMember(new HostLaneClose());
}
}
final class HostLaneHostUri implements HostMethod<Lane> {
@Override
public String key() {
return "hostUri";
}
@Override
public Object invoke(Bridge bridge, Lane lane, Object... arguments) {
return lane.hostUri();
}
}
final class HostLaneNodeUri implements HostMethod<Lane> {
@Override
public String key() {
return "nodeUri";
}
@Override
public Object invoke(Bridge bridge, Lane lane, Object... arguments) {
return lane.nodeUri();
}
}
final class HostLaneLaneUri implements HostMethod<Lane> {
@Override
public String key() {
return "laneUri";
}
@Override
public Object invoke(Bridge bridge, Lane lane, Object... arguments) {
return lane.laneUri();
}
}
final class HostLaneClose implements HostMethod<Lane> {
@Override
public String key() {
return "close";
}
@Override
public Object invoke(Bridge bridge, Lane lane, Object... arguments) {
lane.close();
return null;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/HostLink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api;
import swim.api.Link;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostLink {
private HostLink() {
// static
}
public static final HostObjectType<Link> TYPE;
static {
final JavaHostObjectType<Link> type = new JavaHostObjectType<>(Link.class);
TYPE = type;
type.inheritType(HostObject.TYPE); // FIXME: replace with type.inheritType(HostLog.TYPE);
type.addMember(new HostLinkHostUri());
type.addMember(new HostLinkNodeUri());
type.addMember(new HostLinkLaneUri());
}
}
final class HostLinkHostUri implements HostMethod<Link> {
@Override
public String key() {
return "hostUri";
}
@Override
public Object invoke(Bridge bridge, Link link, Object... arguments) {
return link.hostUri();
}
}
final class HostLinkNodeUri implements HostMethod<Link> {
@Override
public String key() {
return "nodeUri";
}
@Override
public Object invoke(Bridge bridge, Link link, Object... arguments) {
return link.nodeUri();
}
}
final class HostLinkLaneUri implements HostMethod<Link> {
@Override
public String key() {
return "laneUri";
}
@Override
public Object invoke(Bridge bridge, Link link, Object... arguments) {
return link.laneUri();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/SwimApi.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api;
import swim.dynamic.HostLibrary;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostLibrary;
import swim.dynamic.JavaHostPackage;
import swim.dynamic.api.agent.SwimApiAgent;
import swim.dynamic.api.lane.SwimApiLane;
import swim.dynamic.api.plane.SwimApiPlane;
import swim.dynamic.api.warp.SwimApiWarp;
public final class SwimApi {
private SwimApi() {
// static
}
public static final HostPackage PACKAGE;
public static final HostLibrary LIBRARY;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("swim.api");
PACKAGE = hostPkg;
hostPkg.addHostType(HostLane.TYPE);
hostPkg.addHostType(HostLink.TYPE);
final JavaHostLibrary hostLib = new JavaHostLibrary("swim.api");
LIBRARY = hostLib;
hostLib.addHostPackage(SwimApi.PACKAGE);
hostLib.addHostPackage(SwimApiAgent.PACKAGE);
hostLib.addHostPackage(SwimApiLane.PACKAGE);
hostLib.addHostPackage(SwimApiPlane.PACKAGE);
hostLib.addHostPackage(SwimApiWarp.PACKAGE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api dynamic language bindings.
*/
package swim.dynamic.api;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/GuestAgent.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.agent.Agent;
import swim.api.agent.AgentContext;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestAgent extends BridgeGuest implements Agent {
protected final AgentContext agentContext;
public GuestAgent(Bridge bridge, Object guest, AgentContext agentContext) {
super(bridge, guest);
this.agentContext = agentContext;
}
@Override
public AgentContext agentContext() {
return this.agentContext;
}
@Override
public void willOpen() {
if (this.bridge.guestCanInvokeMember(this.guest, "willOpen")) {
this.bridge.guestInvokeMember(this.guest, "willOpen");
}
}
@Override
public void didOpen() {
if (this.bridge.guestCanInvokeMember(this.guest, "didOpen")) {
this.bridge.guestInvokeMember(this.guest, "didOpen");
}
}
@Override
public void willLoad() {
if (this.bridge.guestCanInvokeMember(this.guest, "willLoad")) {
this.bridge.guestInvokeMember(this.guest, "willLoad");
}
}
@Override
public void didLoad() {
if (this.bridge.guestCanInvokeMember(this.guest, "didLoad")) {
this.bridge.guestInvokeMember(this.guest, "didLoad");
}
}
@Override
public void willStart() {
if (this.bridge.guestCanInvokeMember(this.guest, "willStart")) {
this.bridge.guestInvokeMember(this.guest, "willStart");
}
}
@Override
public void didStart() {
if (this.bridge.guestCanInvokeMember(this.guest, "didStart")) {
this.bridge.guestInvokeMember(this.guest, "didStart");
}
}
@Override
public void willStop() {
if (this.bridge.guestCanInvokeMember(this.guest, "willStop")) {
this.bridge.guestInvokeMember(this.guest, "willStop");
}
}
@Override
public void didStop() {
if (this.bridge.guestCanInvokeMember(this.guest, "didStop")) {
this.bridge.guestInvokeMember(this.guest, "didStop");
}
}
@Override
public void willUnload() {
if (this.bridge.guestCanInvokeMember(this.guest, "willUnload")) {
this.bridge.guestInvokeMember(this.guest, "willUnload");
}
}
@Override
public void didUnload() {
if (this.bridge.guestCanInvokeMember(this.guest, "didUnload")) {
this.bridge.guestInvokeMember(this.guest, "didUnload");
}
}
@Override
public void willClose() {
if (this.bridge.guestCanInvokeMember(this.guest, "willClose")) {
this.bridge.guestInvokeMember(this.guest, "willClose");
}
}
@Override
public void didClose() {
if (this.bridge.guestCanInvokeMember(this.guest, "didClose")) {
this.bridge.guestInvokeMember(this.guest, "didClose");
}
}
@Override
public void didFail(Throwable error) {
if (this.bridge.guestCanInvokeMember(this.guest, "didFail")) {
this.bridge.guestInvokeMember(this.guest, "didFail", error);
}
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/GuestAgentRoute.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.agent.Agent;
import swim.api.agent.AgentContext;
import swim.api.agent.AgentRoute;
import swim.api.agent.AgentRouteContext;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
import swim.structure.Value;
import swim.uri.Uri;
import swim.uri.UriPattern;
public class GuestAgentRoute extends BridgeGuest implements AgentRoute<Agent> {
protected AgentRouteContext context;
public GuestAgentRoute(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public AgentRouteContext agentRouteContext() {
return this.context;
}
@Override
public void setAgentRouteContext(AgentRouteContext context) {
this.context = context;
}
@Override
public String routeName() {
return this.context.routeName();
}
@Override
public UriPattern pattern() {
return this.context.pattern();
}
@Override
public Agent createAgent(AgentContext context) {
if (this.bridge.guestCanInvokeMember(this.guest, "createAgent")) {
final Object agent = this.bridge.guestInvokeMember(this.guest, "createAgent", context);
if (agent instanceof Agent) {
return (Agent) agent;
} else if (agent != null) {
return new GuestAgent(this.bridge, agent, context);
}
}
return null;
}
@Override
public Value props(Uri nodeUri) {
if (this.bridge.guestCanInvokeMember(this.guest, "props")) {
final Object props = this.bridge.guestInvokeMember(this.guest, "props", nodeUri);
if (props instanceof Value) {
return (Value) props;
}
}
return Value.absent();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/HostAgent.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.agent.Agent;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostAgent {
private HostAgent() {
// static
}
public static final HostObjectType<Agent> TYPE;
static {
final JavaHostObjectType<Agent> type = new JavaHostObjectType<>(Agent.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostAgentAgentContext());
}
}
final class HostAgentAgentContext implements HostMethod<Agent> {
@Override
public String key() {
return "agentContext";
}
@Override
public Object invoke(Bridge bridge, Agent agent, Object... arguments) {
return agent.agentContext();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/HostAgentContext.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.Lane;
import swim.api.agent.AgentContext;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.lane.HostLaneFactory;
import swim.structure.Value;
import swim.uri.Uri;
public final class HostAgentContext {
private HostAgentContext() {
// static
}
public static final HostObjectType<AgentContext> TYPE;
static {
final JavaHostObjectType<AgentContext> type = new JavaHostObjectType<>(AgentContext.class);
TYPE = type;
// FIXME: type.inheritType(HostSwimRef.TYPE);
type.extendType(HostLaneFactory.TYPE);
// FIXME: type.inheritType(HostStore.TYPE);
// FIXME: type.inheritType(HostLog.TYPE);
type.addMember(new HostAgentContextHostUri());
type.addMember(new HostAgentContextNodeUri());
type.addMember(new HostAgentContextProps());
type.addMember(new HostAgentContextGetProp());
type.addMember(new HostAgentContextSchedule());
type.addMember(new HostAgentContextStage());
type.addMember(new HostAgentContextGetLane());
type.addMember(new HostAgentContextOpenLane());
}
}
final class HostAgentContextHostUri implements HostMethod<AgentContext> {
@Override
public String key() {
return "hostUri";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
return agentContext.hostUri();
}
}
final class HostAgentContextNodeUri implements HostMethod<AgentContext> {
@Override
public String key() {
return "nodeUri";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
return agentContext.nodeUri();
}
}
final class HostAgentContextProps implements HostMethod<AgentContext> {
@Override
public String key() {
return "props";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
return agentContext.props();
}
}
final class HostAgentContextGetProp implements HostMethod<AgentContext> {
@Override
public String key() {
return "getProp";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
final Object key = arguments[0];
if (key instanceof Value) {
return agentContext.getProp((Value) key);
} else if (key instanceof String) {
return agentContext.getProp((String) key);
} else {
throw new ClassCastException(key.toString());
}
}
}
final class HostAgentContextSchedule implements HostMethod<AgentContext> {
@Override
public String key() {
return "schedule";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
return agentContext.schedule();
}
}
final class HostAgentContextStage implements HostMethod<AgentContext> {
@Override
public String key() {
return "stage";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
return agentContext.stage();
}
}
final class HostAgentContextGetLane implements HostMethod<AgentContext> {
@Override
public String key() {
return "getLane";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
Object laneUri = arguments[0];
if (laneUri == null) {
throw new NullPointerException();
}
if (laneUri instanceof String) {
laneUri = Uri.parse((String) laneUri);
}
return agentContext.getLane((Uri) laneUri);
}
}
final class HostAgentContextOpenLane implements HostMethod<AgentContext> {
@Override
public String key() {
return "openLane";
}
@Override
public Object invoke(Bridge bridge, AgentContext agentContext, Object... arguments) {
Object laneUri = arguments[0];
if (laneUri == null) {
throw new NullPointerException();
}
if (laneUri instanceof String) {
laneUri = Uri.parse((String) laneUri);
}
final Object lane = arguments[1];
if (lane == null) {
throw new NullPointerException();
}
return agentContext.openLane((Uri) laneUri, (Lane) lane);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/HostAgentFactory.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.agent.Agent;
import swim.api.agent.AgentContext;
import swim.api.agent.AgentFactory;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostAgentFactory {
private HostAgentFactory() {
// static
}
public static final HostObjectType<AgentFactory<Agent>> TYPE;
static {
final JavaHostObjectType<AgentFactory<Agent>> type = new JavaHostObjectType<>(AgentFactory.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostAgentFactoryCreateAgent());
}
}
final class HostAgentFactoryCreateAgent implements HostMethod<AgentFactory<Agent>> {
@Override
public String key() {
return "createAgent";
}
@Override
public Object invoke(Bridge bridge, AgentFactory<Agent> agentFactory, Object... arguments) {
final AgentContext agentContext = (AgentContext) arguments[0];
return agentFactory.createAgent(agentContext);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/HostAgentRoute.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.agent.Agent;
import swim.api.agent.AgentRoute;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
public final class HostAgentRoute {
private HostAgentRoute() {
// static
}
public static final HostObjectType<AgentRoute<Agent>> TYPE;
static {
final JavaHostObjectType<AgentRoute<Agent>> type = new JavaHostObjectType<>(AgentRoute.class);
TYPE = type;
type.extendType(HostAgentFactory.TYPE);
type.addMember(new HostAgentRouteAgentRouteContext());
type.addMember(new HostAgentRouteRouteName());
type.addMember(new HostAgentRoutePattern());
}
}
final class HostAgentRouteAgentRouteContext implements HostMethod<AgentRoute<Agent>> {
@Override
public String key() {
return "agentRouteContext";
}
@Override
public Object invoke(Bridge bridge, AgentRoute<Agent> agentRoute, Object... arguments) {
return agentRoute.agentRouteContext();
}
}
final class HostAgentRouteRouteName implements HostMethod<AgentRoute<Agent>> {
@Override
public String key() {
return "routeName";
}
@Override
public Object invoke(Bridge bridge, AgentRoute<Agent> agentRoute, Object... arguments) {
return agentRoute.routeName();
}
}
final class HostAgentRoutePattern implements HostMethod<AgentRoute<Agent>> {
@Override
public String key() {
return "pattern";
}
@Override
public Object invoke(Bridge bridge, AgentRoute<Agent> agentRoute, Object... arguments) {
return agentRoute.pattern();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/HostAgentRouteContext.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.api.agent.AgentRouteContext;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostAgentRouteContext {
private HostAgentRouteContext() {
// static
}
public static final HostObjectType<AgentRouteContext> TYPE;
static {
final JavaHostObjectType<AgentRouteContext> type = new JavaHostObjectType<>(AgentRouteContext.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostAgentRouteContextRouteName());
type.addMember(new HostAgentRouteContextPattern());
}
}
final class HostAgentRouteContextRouteName implements HostMethod<AgentRouteContext> {
@Override
public String key() {
return "routeName";
}
@Override
public Object invoke(Bridge bridge, AgentRouteContext agentRouteContext, Object... arguments) {
return agentRouteContext.routeName();
}
}
final class HostAgentRouteContextPattern implements HostMethod<AgentRouteContext> {
@Override
public String key() {
return "pattern";
}
@Override
public Object invoke(Bridge bridge, AgentRouteContext agentRouteContext, Object... arguments) {
return agentRouteContext.pattern();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/SwimApiAgent.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.agent;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostPackage;
public final class SwimApiAgent {
private SwimApiAgent() {
// static
}
public static final HostPackage PACKAGE;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("swim.api.agent");
PACKAGE = hostPkg;
hostPkg.addHostType(HostAgent.TYPE);
hostPkg.addHostType(HostAgentContext.TYPE);
hostPkg.addHostType(HostAgentFactory.TYPE);
hostPkg.addHostType(HostAgentRoute.TYPE);
hostPkg.addHostType(HostAgentRouteContext.TYPE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/agent/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.agent dynamic language bindings.
*/
package swim.dynamic.api.agent;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/function/GuestDidClose.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.function;
import swim.api.function.DidClose;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidClose extends BridgeGuest implements DidClose {
public GuestDidClose(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didClose() {
this.bridge.guestExecuteVoid(this.guest);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/function/GuestDidConnect.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.function;
import swim.api.function.DidConnect;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidConnect extends BridgeGuest implements DidConnect {
public GuestDidConnect(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didConnect() {
this.bridge.guestExecuteVoid(this.guest);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/function/GuestDidDisconnect.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.function;
import swim.api.function.DidDisconnect;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidDisconnect extends BridgeGuest implements DidDisconnect {
public GuestDidDisconnect(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didDisconnect() {
this.bridge.guestExecuteVoid(this.guest);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/function/GuestDidFail.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.function;
import swim.api.function.DidFail;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidFail extends BridgeGuest implements DidFail {
public GuestDidFail(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didFail(Throwable error) {
this.bridge.guestExecuteVoid(this.guest, error);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/function/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.function dynamic language bindings.
*/
package swim.dynamic.api.function;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostCommandLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.CommandLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.api.warp.function.GuestOnCommand;
public final class HostCommandLane {
private HostCommandLane() {
// static
}
public static final HostObjectType<CommandLane<Object>> TYPE;
static {
final JavaHostObjectType<CommandLane<Object>> type = new JavaHostObjectType<>(CommandLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.addMember(new HostCommandLaneObserve());
type.addMember(new HostCommandLaneUnobserve());
type.addMember(new HostCommandLaneOnCommand());
}
}
final class HostCommandLaneObserve implements HostMethod<CommandLane<Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, CommandLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostCommandLaneUnobserve implements HostMethod<CommandLane<Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, CommandLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
final class HostCommandLaneOnCommand implements HostMethod<CommandLane<Object>> {
@Override
public String key() {
return "onCommand";
}
@Override
public Object invoke(Bridge bridge, CommandLane<Object> lane, Object... arguments) {
return lane.onCommand(new GuestOnCommand<Object>(bridge, arguments[0]));
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostDemandLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.DemandLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.lane.function.GuestOnCue;
import swim.dynamic.api.warp.HostWarpLane;
public final class HostDemandLane {
private HostDemandLane() {
// static
}
public static final HostObjectType<DemandLane<Object>> TYPE;
static {
final JavaHostObjectType<DemandLane<Object>> type = new JavaHostObjectType<>(DemandLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.addMember(new HostDemandLaneObserve());
type.addMember(new HostDemandLaneUnobserve());
type.addMember(new HostDemandLaneOnCue());
type.addMember(new HostDemandLaneCue());
}
}
final class HostDemandLaneObserve implements HostMethod<DemandLane<Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, DemandLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostDemandLaneUnobserve implements HostMethod<DemandLane<Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, DemandLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
final class HostDemandLaneOnCue implements HostMethod<DemandLane<Object>> {
@Override
public String key() {
return "onCue";
}
@Override
public Object invoke(Bridge bridge, DemandLane<Object> lane, Object... arguments) {
return lane.onCue(new GuestOnCue<Object>(bridge, arguments[0]));
}
}
final class HostDemandLaneCue implements HostMethod<DemandLane<Object>> {
@Override
public String key() {
return "cue";
}
@Override
public Object invoke(Bridge bridge, DemandLane<Object> lane, Object... arguments) {
lane.cue();
return null;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostDemandMapLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.DemandMapLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.lane.function.GuestOnCueKey;
import swim.dynamic.api.lane.function.GuestOnSyncMap;
import swim.dynamic.api.warp.HostWarpLane;
public final class HostDemandMapLane {
private HostDemandMapLane() {
// static
}
public static final HostObjectType<DemandMapLane<Object, Object>> TYPE;
static {
final JavaHostObjectType<DemandMapLane<Object, Object>> type = new JavaHostObjectType<>(DemandMapLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.addMember(new HostDemandMapLaneObserve());
type.addMember(new HostDemandMapLaneUnobserve());
type.addMember(new HostDemandMapLaneOnCue());
type.addMember(new HostDemandMapLaneOnSync());
type.addMember(new HostDemandMapLaneCue());
type.addMember(new HostDemandMapLaneRemove());
}
}
final class HostDemandMapLaneObserve implements HostMethod<DemandMapLane<Object, Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, DemandMapLane<Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostDemandMapLaneUnobserve implements HostMethod<DemandMapLane<Object, Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, DemandMapLane<Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
final class HostDemandMapLaneOnCue implements HostMethod<DemandMapLane<Object, Object>> {
@Override
public String key() {
return "onCue";
}
@Override
public Object invoke(Bridge bridge, DemandMapLane<Object, Object> lane, Object... arguments) {
return lane.onCue(new GuestOnCueKey<Object, Object>(bridge, arguments[0]));
}
}
final class HostDemandMapLaneOnSync implements HostMethod<DemandMapLane<Object, Object>> {
@Override
public String key() {
return "onSync";
}
@Override
public Object invoke(Bridge bridge, DemandMapLane<Object, Object> lane, Object... arguments) {
return lane.onSync(new GuestOnSyncMap<Object, Object>(bridge, arguments[0]));
}
}
final class HostDemandMapLaneCue implements HostMethod<DemandMapLane<Object, Object>> {
@Override
public String key() {
return "cue";
}
@Override
public Object invoke(Bridge bridge, DemandMapLane<Object, Object> lane, Object... arguments) {
lane.cue(arguments[0]);
return null;
}
}
final class HostDemandMapLaneRemove implements HostMethod<DemandMapLane<Object, Object>> {
@Override
public String key() {
return "remove";
}
@Override
public Object invoke(Bridge bridge, DemandMapLane<Object, Object> lane, Object... arguments) {
lane.remove(arguments[0]);
return null;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostJoinMapLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.JoinMapLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.lane.function.GuestDidDownlinkMap;
import swim.dynamic.api.lane.function.GuestWillDownlinkMap;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.java.lang.HostIterable;
import swim.dynamic.observable.HostObservableMap;
public final class HostJoinMapLane {
private HostJoinMapLane() {
// static
}
public static final HostObjectType<JoinMapLane<Object, Object, Object>> TYPE;
static {
final JavaHostObjectType<JoinMapLane<Object, Object, Object>> type = new JavaHostObjectType<>(JoinMapLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.inheritType(HostIterable.TYPE);
type.inheritType(HostObservableMap.TYPE);
type.addMember(new HostJoinMapLaneIsResident());
type.addMember(new HostJoinMapLaneIsTransient());
type.addMember(new HostJoinMapLaneObserve());
type.addMember(new HostJoinMapLaneUnobserve());
type.addMember(new HostJoinMapLaneWillDownlink());
type.addMember(new HostJoinMapLaneDidDownlink());
type.addMember(new HostJoinMapLaneDownlink());
type.addMember(new HostJoinMapLaneGetDownlink());
}
}
final class HostJoinMapLaneIsResident implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "isResident";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
final Object isResident = arguments.length == 0 ? null : arguments[0];
if (isResident == null) {
return lane.isResident();
} else {
return lane.isResident((boolean) isResident);
}
}
}
final class HostJoinMapLaneIsTransient implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "isTransient";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
final Object isTransient = arguments.length == 0 ? null : arguments[0];
if (isTransient == null) {
return lane.isTransient();
} else {
return lane.isTransient((boolean) isTransient);
}
}
}
final class HostJoinMapLaneObserve implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostJoinMapLaneUnobserve implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
final class HostJoinMapLaneWillDownlink implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "willDownlink";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
return lane.willDownlink(new GuestWillDownlinkMap<Object>(bridge, arguments[0]));
}
}
final class HostJoinMapLaneDidDownlink implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "didDownlink";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
return lane.didDownlink(new GuestDidDownlinkMap<Object>(bridge, arguments[0]));
}
}
final class HostJoinMapLaneDownlink implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "downlink";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
return lane.downlink(arguments[0]);
}
}
final class HostJoinMapLaneGetDownlink implements HostMethod<JoinMapLane<Object, Object, Object>> {
@Override
public String key() {
return "getDownlink";
}
@Override
public Object invoke(Bridge bridge, JoinMapLane<Object, Object, Object> lane, Object... arguments) {
return lane.getDownlink(arguments[0]);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostJoinValueLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.JoinValueLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.lane.function.GuestDidDownlinkValue;
import swim.dynamic.api.lane.function.GuestWillDownlinkValue;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.java.lang.HostIterable;
import swim.dynamic.observable.HostObservableMap;
public final class HostJoinValueLane {
private HostJoinValueLane() {
// static
}
public static final HostObjectType<JoinValueLane<Object, Object>> TYPE;
static {
final JavaHostObjectType<JoinValueLane<Object, Object>> type = new JavaHostObjectType<>(JoinValueLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.inheritType(HostIterable.TYPE);
type.inheritType(HostObservableMap.TYPE);
type.addMember(new HostJoinValueLaneIsResident());
type.addMember(new HostJoinValueLaneIsTransient());
type.addMember(new HostJoinValueLaneObserve());
type.addMember(new HostJoinValueLaneUnobserve());
type.addMember(new HostJoinValueLaneWillDownlink());
type.addMember(new HostJoinValueLaneDidDownlink());
type.addMember(new HostJoinValueLaneDownlink());
type.addMember(new HostJoinValueLaneGetDownlink());
}
}
final class HostJoinValueLaneIsResident implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "isResident";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
final Object isResident = arguments.length == 0 ? null : arguments[0];
if (isResident == null) {
return lane.isResident();
} else {
return lane.isResident((boolean) isResident);
}
}
}
final class HostJoinValueLaneIsTransient implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "isTransient";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
final Object isTransient = arguments.length == 0 ? null : arguments[0];
if (isTransient == null) {
return lane.isTransient();
} else {
return lane.isTransient((boolean) isTransient);
}
}
}
final class HostJoinValueLaneObserve implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostJoinValueLaneUnobserve implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
final class HostJoinValueLaneWillDownlink implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "willDownlink";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
return lane.willDownlink(new GuestWillDownlinkValue<Object>(bridge, arguments[0]));
}
}
final class HostJoinValueLaneDidDownlink implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "didDownlink";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
return lane.didDownlink(new GuestDidDownlinkValue<Object>(bridge, arguments[0]));
}
}
final class HostJoinValueLaneDownlink implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "downlink";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
return lane.downlink(arguments[0]);
}
}
final class HostJoinValueLaneGetDownlink implements HostMethod<JoinValueLane<Object, Object>> {
@Override
public String key() {
return "getDownlink";
}
@Override
public Object invoke(Bridge bridge, JoinValueLane<Object, Object> lane, Object... arguments) {
return lane.getDownlink(arguments[0]);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostLaneFactory.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.LaneFactory;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
import swim.math.Z2Form;
import swim.structure.Form;
public final class HostLaneFactory {
private HostLaneFactory() {
// static
}
public static final HostObjectType<LaneFactory> TYPE;
static {
final JavaHostObjectType<LaneFactory> type = new JavaHostObjectType<>(LaneFactory.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostLaneFactoryCommandLane());
type.addMember(new HostLaneFactoryDemandLane());
type.addMember(new HostLaneFactoryDemandMapLane());
type.addMember(new HostLaneFactoryJoinMapLane());
type.addMember(new HostLaneFactoryJoinValueLane());
type.addMember(new HostLaneFactoryListLane());
type.addMember(new HostLaneFactoryMapLane());
type.addMember(new HostLaneFactorySpatialLane());
type.addMember(new HostLaneFactoryGeospatialLane());
type.addMember(new HostLaneFactorySupplyLane());
type.addMember(new HostLaneFactoryValueLane());
}
}
final class HostLaneFactoryCommandLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "commandLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.commandLane()
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryDemandLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "demandLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.demandLane()
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryDemandMapLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "demandMapLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.demandMapLane()
.keyForm(Form.forValue())
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryJoinMapLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "joinMapLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.joinMapLane()
.linkForm(Form.forValue())
.keyForm(Form.forValue())
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryJoinValueLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "joinValueLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.joinValueLane()
.keyForm(Form.forValue())
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryListLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "listLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.listLane()
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryMapLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "mapLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.mapLane()
.keyForm(Form.forValue())
.valueForm(Form.forValue());
}
}
final class HostLaneFactorySpatialLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "spatialLane";
}
@SuppressWarnings("unchecked")
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.spatialLane((Z2Form<Object>) arguments[0])
.keyForm(Form.forValue())
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryGeospatialLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "geospatialLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.geospatialLane()
.keyForm(Form.forValue())
.valueForm(Form.forValue());
}
}
final class HostLaneFactorySupplyLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "supplyLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.supplyLane()
.valueForm(Form.forValue());
}
}
final class HostLaneFactoryValueLane implements HostMethod<LaneFactory> {
@Override
public String key() {
return "valueLane";
}
@Override
public Object invoke(Bridge bridge, LaneFactory laneFactory, Object... arguments) {
return laneFactory.valueLane()
.valueForm(Form.forValue());
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostListLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.ListLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.observable.HostObservableList;
public final class HostListLane {
private HostListLane() {
// static
}
public static final HostObjectType<ListLane<Object>> TYPE;
static {
final JavaHostObjectType<ListLane<Object>> type = new JavaHostObjectType<>(ListLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
// FIXME: type.inheritType(HostKeyedList.TYPE);
type.inheritType(HostObservableList.TYPE);
type.addMember(new HostListLaneIsResident());
type.addMember(new HostListLaneIsTransient());
type.addMember(new HostListLaneObserve());
type.addMember(new HostListLaneUnobserve());
}
}
final class HostListLaneIsResident implements HostMethod<ListLane<Object>> {
@Override
public String key() {
return "isResident";
}
@Override
public Object invoke(Bridge bridge, ListLane<Object> lane, Object... arguments) {
final Object isResident = arguments.length == 0 ? null : arguments[0];
if (isResident == null) {
return lane.isResident();
} else {
return lane.isResident((boolean) isResident);
}
}
}
final class HostListLaneIsTransient implements HostMethod<ListLane<Object>> {
@Override
public String key() {
return "isTransient";
}
@Override
public Object invoke(Bridge bridge, ListLane<Object> lane, Object... arguments) {
final Object isTransient = arguments.length == 0 ? null : arguments[0];
if (isTransient == null) {
return lane.isTransient();
} else {
return lane.isTransient((boolean) isTransient);
}
}
}
final class HostListLaneObserve implements HostMethod<ListLane<Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, ListLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostListLaneUnobserve implements HostMethod<ListLane<Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, ListLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostMapLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.MapLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.observable.HostObservableSortedMap;
public final class HostMapLane {
private HostMapLane() {
// static
}
public static final HostObjectType<MapLane<Object, Object>> TYPE;
static {
final JavaHostObjectType<MapLane<Object, Object>> type = new JavaHostObjectType<>(MapLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.inheritType(HostObservableSortedMap.TYPE);
type.addMember(new HostMapLaneIsResident());
type.addMember(new HostMapLaneIsTransient());
type.addMember(new HostMapLaneObserve());
type.addMember(new HostMapLaneUnobserve());
}
}
final class HostMapLaneIsResident implements HostMethod<MapLane<Object, Object>> {
@Override
public String key() {
return "isResident";
}
@Override
public Object invoke(Bridge bridge, MapLane<Object, Object> lane, Object... arguments) {
final Object isResident = arguments.length == 0 ? null : arguments[0];
if (isResident == null) {
return lane.isResident();
} else {
return lane.isResident((boolean) isResident);
}
}
}
final class HostMapLaneIsTransient implements HostMethod<MapLane<Object, Object>> {
@Override
public String key() {
return "isTransient";
}
@Override
public Object invoke(Bridge bridge, MapLane<Object, Object> lane, Object... arguments) {
final Object isTransient = arguments.length == 0 ? null : arguments[0];
if (isTransient == null) {
return lane.isTransient();
} else {
return lane.isTransient((boolean) isTransient);
}
}
}
final class HostMapLaneObserve implements HostMethod<MapLane<Object, Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, MapLane<Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostMapLaneUnobserve implements HostMethod<MapLane<Object, Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, MapLane<Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostSpatialLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.SpatialLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.observable.HostObservableSpatialMap;
public final class HostSpatialLane {
private HostSpatialLane() {
// static
}
public static final HostObjectType<SpatialLane<Object, Object, Object>> TYPE;
static {
final JavaHostObjectType<SpatialLane<Object, Object, Object>> type = new JavaHostObjectType<>(SpatialLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.inheritType(HostObservableSpatialMap.TYPE);
type.addMember(new HostSpatialLaneIsResident());
type.addMember(new HostSpatialLaneIsTransient());
type.addMember(new HostSpatialLaneObserve());
type.addMember(new HostSpatialLaneUnobserve());
}
}
final class HostSpatialLaneIsResident implements HostMethod<SpatialLane<Object, Object, Object>> {
@Override
public String key() {
return "isResident";
}
@Override
public Object invoke(Bridge bridge, SpatialLane<Object, Object, Object> lane, Object... arguments) {
final Object isResident = arguments.length == 0 ? null : arguments[0];
if (isResident == null) {
return lane.isResident();
} else {
return lane.isResident((boolean) isResident);
}
}
}
final class HostSpatialLaneIsTransient implements HostMethod<SpatialLane<Object, Object, Object>> {
@Override
public String key() {
return "isTransient";
}
@Override
public Object invoke(Bridge bridge, SpatialLane<Object, Object, Object> lane, Object... arguments) {
final Object isTransient = arguments.length == 0 ? null : arguments[0];
if (isTransient == null) {
return lane.isTransient();
} else {
return lane.isTransient((boolean) isTransient);
}
}
}
final class HostSpatialLaneObserve implements HostMethod<SpatialLane<Object, Object, Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, SpatialLane<Object, Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostSpatialLaneUnobserve implements HostMethod<SpatialLane<Object, Object, Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, SpatialLane<Object, Object, Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostSupplyLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.SupplyLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.warp.HostWarpLane;
public final class HostSupplyLane {
private HostSupplyLane() {
// static
}
public static final HostObjectType<SupplyLane<Object>> TYPE;
static {
final JavaHostObjectType<SupplyLane<Object>> type = new JavaHostObjectType<>(SupplyLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.addMember(new HostSupplyLaneObserve());
type.addMember(new HostSupplyLaneUnobserve());
type.addMember(new HostSupplyLanePush());
}
}
final class HostSupplyLaneObserve implements HostMethod<SupplyLane<Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, SupplyLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostSupplyLaneUnobserve implements HostMethod<SupplyLane<Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, SupplyLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
final class HostSupplyLanePush implements HostMethod<SupplyLane<Object>> {
@Override
public String key() {
return "push";
}
@Override
public Object invoke(Bridge bridge, SupplyLane<Object> lane, Object... arguments) {
lane.push(arguments[0]);
return null;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/HostValueLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.api.lane.ValueLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.warp.HostWarpLane;
import swim.dynamic.observable.HostObservableValue;
public final class HostValueLane {
private HostValueLane() {
// static
}
public static final HostObjectType<ValueLane<Object>> TYPE;
static {
final JavaHostObjectType<ValueLane<Object>> type = new JavaHostObjectType<>(ValueLane.class);
TYPE = type;
type.inheritType(HostWarpLane.TYPE);
type.inheritType(HostObservableValue.TYPE);
type.addMember(new HostValueLaneIsResident());
type.addMember(new HostValueLaneIsTransient());
type.addMember(new HostValueLaneObserve());
type.addMember(new HostValueLaneUnobserve());
}
}
final class HostValueLaneIsResident implements HostMethod<ValueLane<Object>> {
@Override
public String key() {
return "isResident";
}
@Override
public Object invoke(Bridge bridge, ValueLane<Object> lane, Object... arguments) {
final Object isResident = arguments.length == 0 ? null : arguments[0];
if (isResident == null) {
return lane.isResident();
} else {
return lane.isResident((boolean) isResident);
}
}
}
final class HostValueLaneIsTransient implements HostMethod<ValueLane<Object>> {
@Override
public String key() {
return "isTransient";
}
@Override
public Object invoke(Bridge bridge, ValueLane<Object> lane, Object... arguments) {
final Object isTransient = arguments.length == 0 ? null : arguments[0];
if (isTransient == null) {
return lane.isTransient();
} else {
return lane.isTransient((boolean) isTransient);
}
}
}
final class HostValueLaneObserve implements HostMethod<ValueLane<Object>> {
@Override
public String key() {
return "observe";
}
@Override
public Object invoke(Bridge bridge, ValueLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.observe(observer);
return this;
}
}
final class HostValueLaneUnobserve implements HostMethod<ValueLane<Object>> {
@Override
public String key() {
return "unobserve";
}
@Override
public Object invoke(Bridge bridge, ValueLane<Object> lane, Object... arguments) {
final Object observer = arguments[0];
// TODO: bridge observer callback members.
lane.unobserve(observer);
return this;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/SwimApiLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostPackage;
public final class SwimApiLane {
private SwimApiLane() {
// static
}
public static final HostPackage PACKAGE;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("swim.api.lane");
PACKAGE = hostPkg;
hostPkg.addHostType(HostCommandLane.TYPE);
hostPkg.addHostType(HostDemandLane.TYPE);
hostPkg.addHostType(HostDemandMapLane.TYPE);
hostPkg.addHostType(HostJoinMapLane.TYPE);
hostPkg.addHostType(HostJoinValueLane.TYPE);
hostPkg.addHostType(HostListLane.TYPE);
hostPkg.addHostType(HostMapLane.TYPE);
hostPkg.addHostType(HostSpatialLane.TYPE);
hostPkg.addHostType(HostSupplyLane.TYPE);
hostPkg.addHostType(HostValueLane.TYPE);
hostPkg.addHostType(HostLaneFactory.TYPE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.lane dynamic language bindings.
*/
package swim.dynamic.api.lane;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestDidDownlinkMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import swim.api.downlink.MapDownlink;
import swim.api.lane.function.DidDownlinkMap;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidDownlinkMap<L> extends BridgeGuest implements DidDownlinkMap<L> {
public GuestDidDownlinkMap(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didDownlink(L key, MapDownlink<?, ?> downlink) {
this.bridge.guestExecuteVoid(this.guest, key, downlink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestDidDownlinkValue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import swim.api.downlink.ValueDownlink;
import swim.api.lane.function.DidDownlinkValue;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidDownlinkValue<K> extends BridgeGuest implements DidDownlinkValue<K> {
public GuestDidDownlinkValue(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didDownlink(K key, ValueDownlink<?> downlink) {
this.bridge.guestExecuteVoid(this.guest, key, downlink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestOnCue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import swim.api.lane.function.OnCue;
import swim.api.warp.WarpUplink;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestOnCue<V> extends BridgeGuest implements OnCue<V> {
public GuestOnCue(Bridge bridge, Object guest) {
super(bridge, guest);
}
@SuppressWarnings("unchecked")
@Override
public V onCue(WarpUplink uplink) {
return (V) this.bridge.guestExecute(this.guest, uplink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestOnCueKey.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import swim.api.lane.function.OnCueKey;
import swim.api.warp.WarpUplink;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestOnCueKey<K, V> extends BridgeGuest implements OnCueKey<K, V> {
public GuestOnCueKey(Bridge bridge, Object guest) {
super(bridge, guest);
}
@SuppressWarnings("unchecked")
@Override
public V onCue(K key, WarpUplink uplink) {
return (V) this.bridge.guestExecute(this.guest, key, uplink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestOnSyncMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import java.util.Iterator;
import java.util.Map;
import swim.api.lane.function.OnSyncMap;
import swim.api.warp.WarpUplink;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestOnSyncMap<K, V> extends BridgeGuest implements OnSyncMap<K, V> {
public GuestOnSyncMap(Bridge bridge, Object guest) {
super(bridge, guest);
}
@SuppressWarnings("unchecked")
@Override
public Iterator<Map.Entry<K, V>> onSync(WarpUplink uplink) {
return (Iterator<Map.Entry<K, V>>) this.bridge.guestExecute(this.guest, uplink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestWillDownlinkMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import swim.api.downlink.MapDownlink;
import swim.api.lane.function.WillDownlinkMap;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestWillDownlinkMap<L> extends BridgeGuest implements WillDownlinkMap<L> {
public GuestWillDownlinkMap(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public MapDownlink<?, ?> willDownlink(L key, MapDownlink<?, ?> downlink) {
final Object result = this.bridge.guestExecute(this.guest, key, downlink);
return result != null ? (MapDownlink<?, ?>) result : downlink;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/GuestWillDownlinkValue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.lane.function;
import swim.api.downlink.ValueDownlink;
import swim.api.lane.function.WillDownlinkValue;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestWillDownlinkValue<K> extends BridgeGuest implements WillDownlinkValue<K> {
public GuestWillDownlinkValue(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public ValueDownlink<?> willDownlink(K key, ValueDownlink<?> downlink) {
final Object result = this.bridge.guestExecute(this.guest, key, downlink);
return result != null ? (ValueDownlink<?>) result : downlink;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/lane/function/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.lane.function dynamic language bindings.
*/
package swim.dynamic.api.lane.function;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/plane/GuestPlane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.plane;
import swim.api.plane.Plane;
import swim.api.plane.PlaneContext;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestPlane extends BridgeGuest implements Plane {
protected final PlaneContext planeContext;
public GuestPlane(Bridge bridge, Object guest, PlaneContext planeContext) {
super(bridge, guest);
this.planeContext = planeContext;
}
@Override
public PlaneContext planeContext() {
return this.planeContext;
}
@Override
public void willStart() {
if (this.bridge.guestCanInvokeMember(this.guest, "willStart")) {
this.bridge.guestInvokeMember(this.guest, "willStart");
}
}
@Override
public void didStart() {
if (this.bridge.guestCanInvokeMember(this.guest, "didStart")) {
this.bridge.guestInvokeMember(this.guest, "didStart");
}
}
@Override
public void willStop() {
if (this.bridge.guestCanInvokeMember(this.guest, "willStop")) {
this.bridge.guestInvokeMember(this.guest, "willStop");
}
}
@Override
public void didStop() {
if (this.bridge.guestCanInvokeMember(this.guest, "didStop")) {
this.bridge.guestInvokeMember(this.guest, "didStop");
}
}
@Override
public void willClose() {
if (this.bridge.guestCanInvokeMember(this.guest, "willClose")) {
this.bridge.guestInvokeMember(this.guest, "willClose");
}
}
@Override
public void didClose() {
if (this.bridge.guestCanInvokeMember(this.guest, "didClose")) {
this.bridge.guestInvokeMember(this.guest, "didClose");
}
}
@Override
public void didFail(Throwable error) {
if (this.bridge.guestCanInvokeMember(this.guest, "didFail")) {
this.bridge.guestInvokeMember(this.guest, "didFail", error);
}
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/plane/HostPlane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.plane;
import swim.api.plane.Plane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostPlane {
private HostPlane() {
// static
}
public static final HostObjectType<Plane> TYPE;
static {
final JavaHostObjectType<Plane> type = new JavaHostObjectType<>(Plane.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostPlanePlaneContext());
}
}
final class HostPlanePlaneContext implements HostMethod<Plane> {
@Override
public String key() {
return "planeContext";
}
@Override
public Object invoke(Bridge bridge, Plane plane, Object... arguments) {
return plane.planeContext();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/plane/HostPlaneContext.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.plane;
import swim.api.agent.AgentRoute;
import swim.api.auth.Authenticator;
import swim.api.plane.PlaneContext;
import swim.api.policy.PlanePolicy;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.agent.GuestAgentRoute;
import swim.dynamic.java.lang.HostObject;
import swim.uri.Uri;
import swim.uri.UriPattern;
public final class HostPlaneContext {
private HostPlaneContext() {
// static
}
public static final HostObjectType<PlaneContext> TYPE;
static {
final JavaHostObjectType<PlaneContext> type = new JavaHostObjectType<>(PlaneContext.class);
TYPE = type;
type.inheritType(HostObject.TYPE); // FIXME: remove once any other base type is inherited
// FIXME: type.inheritType(HostSwimRef.TYPE);
// FIXME: type.inheritType(HostLog.TYPE);
type.addMember(new HostPlaneContextSchedule());
type.addMember(new HostPlaneContextStage());
type.addMember(new HostPlaneContextPolicy());
type.addMember(new HostPlaneContextSetPolicy());
type.addMember(new HostPlaneContextGetAuthenticator());
type.addMember(new HostPlaneContextAddAuthenticator());
type.addMember(new HostPlaneContextGetAgentFactory());
type.addMember(new HostPlaneContextGetAgentRoute());
type.addMember(new HostPlaneContextAddAgentRoute());
type.addMember(new HostPlaneContextRemoveAgentRoute());
}
}
final class HostPlaneContextSchedule implements HostMethod<PlaneContext> {
@Override
public String key() {
return "schedule";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
return planeContext.schedule();
}
}
final class HostPlaneContextStage implements HostMethod<PlaneContext> {
@Override
public String key() {
return "stage";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
return planeContext.stage();
}
}
final class HostPlaneContextPolicy implements HostMethod<PlaneContext> {
@Override
public String key() {
return "policy";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
return planeContext.policy();
}
}
final class HostPlaneContextSetPolicy implements HostMethod<PlaneContext> {
@Override
public String key() {
return "setPolicy";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
final Object policy = arguments[0];
// TODO: convert guest policy to host PlanePolicy.
planeContext.setPolicy((PlanePolicy) policy);
return null;
}
}
final class HostPlaneContextGetAuthenticator implements HostMethod<PlaneContext> {
@Override
public String key() {
return "getAuthenticator";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
final Object authenticatorName = arguments[0];
return planeContext.getAuthenticator((String) authenticatorName);
}
}
final class HostPlaneContextAddAuthenticator implements HostMethod<PlaneContext> {
@Override
public String key() {
return "addAuthenticator";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
final Object authenticatorName = arguments[1];
final Object authenticator = arguments[1];
// TODO: convert guest authenticator to host Authenticator.
planeContext.addAuthenticator((String) authenticatorName, (Authenticator) authenticator);
return null;
}
}
final class HostPlaneContextGetAgentFactory implements HostMethod<PlaneContext> {
@Override
public String key() {
return "getAgentFactory";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
Object nodeUri = arguments[0];
if (nodeUri instanceof String) {
nodeUri = Uri.parse((String) nodeUri);
}
return planeContext.getAgentFactory((Uri) nodeUri);
}
}
final class HostPlaneContextGetAgentRoute implements HostMethod<PlaneContext> {
@Override
public String key() {
return "getAgentRoute";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
final Object routeName = arguments[0];
return planeContext.getAgentRoute((String) routeName);
}
}
final class HostPlaneContextAddAgentRoute implements HostMethod<PlaneContext> {
@Override
public String key() {
return "addAgentRoute";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
final Object routeName = arguments[0];
Object pattern = arguments[1];
if (pattern == null) {
throw new NullPointerException();
}
if (pattern instanceof String) {
pattern = UriPattern.parse((String) pattern);
}
Object agentRoute = arguments[2];
if (agentRoute == null) {
throw new NullPointerException();
}
if (!(agentRoute instanceof AgentRoute<?>)) {
agentRoute = new GuestAgentRoute(bridge, agentRoute);
}
planeContext.addAgentRoute((String) routeName, (UriPattern) pattern, (AgentRoute<?>) agentRoute);
return null;
}
}
final class HostPlaneContextRemoveAgentRoute implements HostMethod<PlaneContext> {
@Override
public String key() {
return "removeAgentRoute";
}
@Override
public Object invoke(Bridge bridge, PlaneContext planeContext, Object... arguments) {
final Object routeName = arguments[0];
planeContext.removeAgentRoute((String) routeName);
return null;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/plane/SwimApiPlane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.plane;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostPackage;
public final class SwimApiPlane {
private SwimApiPlane() {
// static
}
public static final HostPackage PACKAGE;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("swim.api.plane");
PACKAGE = hostPkg;
hostPkg.addHostType(HostPlane.TYPE);
hostPkg.addHostType(HostPlaneContext.TYPE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/plane/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.plane dynamic language bindings.
*/
package swim.dynamic.api.plane;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/HostWarpLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp;
import swim.api.warp.WarpLane;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.api.HostLane;
import swim.dynamic.api.warp.function.GuestDidCommand;
import swim.dynamic.api.warp.function.GuestDidEnter;
import swim.dynamic.api.warp.function.GuestDidLeave;
import swim.dynamic.api.warp.function.GuestDidUplink;
import swim.dynamic.api.warp.function.GuestWillCommand;
import swim.dynamic.api.warp.function.GuestWillEnter;
import swim.dynamic.api.warp.function.GuestWillLeave;
import swim.dynamic.api.warp.function.GuestWillUplink;
public final class HostWarpLane {
private HostWarpLane() {
// static
}
public static final HostObjectType<WarpLane> TYPE;
static {
final JavaHostObjectType<WarpLane> type = new JavaHostObjectType<>(WarpLane.class);
TYPE = type;
type.inheritType(HostLane.TYPE);
type.addMember(new HostWarpLaneWillCommand());
type.addMember(new HostWarpLaneDidCommand());
type.addMember(new HostWarpLaneWillUplink());
type.addMember(new HostWarpLaneDidUplink());
type.addMember(new HostWarpLaneWillEnter());
type.addMember(new HostWarpLaneDidEnter());
type.addMember(new HostWarpLaneWillLeave());
type.addMember(new HostWarpLaneDidLeave());
}
}
final class HostWarpLaneWillCommand implements HostMethod<WarpLane> {
@Override
public String key() {
return "willCommand";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.willCommand(new GuestWillCommand(bridge, arguments[0]));
}
}
final class HostWarpLaneDidCommand implements HostMethod<WarpLane> {
@Override
public String key() {
return "didCommand";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.didCommand(new GuestDidCommand(bridge, arguments[0]));
}
}
final class HostWarpLaneWillUplink implements HostMethod<WarpLane> {
@Override
public String key() {
return "willUplink";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.willUplink(new GuestWillUplink(bridge, arguments[0]));
}
}
final class HostWarpLaneDidUplink implements HostMethod<WarpLane> {
@Override
public String key() {
return "didUplink";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.didUplink(new GuestDidUplink(bridge, arguments[0]));
}
}
final class HostWarpLaneWillEnter implements HostMethod<WarpLane> {
@Override
public String key() {
return "willEnter";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.willEnter(new GuestWillEnter(bridge, arguments[0]));
}
}
final class HostWarpLaneDidEnter implements HostMethod<WarpLane> {
@Override
public String key() {
return "didEnter";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.didEnter(new GuestDidEnter(bridge, arguments[0]));
}
}
final class HostWarpLaneWillLeave implements HostMethod<WarpLane> {
@Override
public String key() {
return "willLeave";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.willLeave(new GuestWillLeave(bridge, arguments[0]));
}
}
final class HostWarpLaneDidLeave implements HostMethod<WarpLane> {
@Override
public String key() {
return "didLeave";
}
@Override
public Object invoke(Bridge bridge, WarpLane lane, Object... arguments) {
return lane.didLeave(new GuestDidLeave(bridge, arguments[0]));
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/SwimApiWarp.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostPackage;
public final class SwimApiWarp {
private SwimApiWarp() {
// static
}
public static final HostPackage PACKAGE;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("swim.api.warp");
PACKAGE = hostPkg;
hostPkg.addHostType(HostWarpLane.TYPE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.warp dynamic language bindings.
*/
package swim.dynamic.api.warp;
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestDidCommand.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.warp.function.DidCommand;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
import swim.structure.Value;
public class GuestDidCommand extends BridgeGuest implements DidCommand {
public GuestDidCommand(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didCommand(Value body) {
this.bridge.guestExecuteVoid(this.guest, body);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestDidEnter.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.auth.Identity;
import swim.api.warp.function.DidEnter;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidEnter extends BridgeGuest implements DidEnter {
public GuestDidEnter(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didEnter(Identity identity) {
this.bridge.guestExecuteVoid(this.guest, identity);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestDidLeave.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.auth.Identity;
import swim.api.warp.function.DidLeave;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidLeave extends BridgeGuest implements DidLeave {
public GuestDidLeave(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didLeave(Identity identity) {
this.bridge.guestExecuteVoid(this.guest, identity);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestDidUplink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.warp.WarpUplink;
import swim.api.warp.function.DidUplink;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestDidUplink extends BridgeGuest implements DidUplink {
public GuestDidUplink(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void didUplink(WarpUplink uplink) {
this.bridge.guestExecuteVoid(this.guest, uplink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestOnCommand.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.warp.function.OnCommand;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestOnCommand<V> extends BridgeGuest implements OnCommand<V> {
public GuestOnCommand(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void onCommand(V value) {
this.bridge.guestExecuteVoid(this.guest, value);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestWillCommand.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.warp.function.WillCommand;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
import swim.structure.Value;
public class GuestWillCommand extends BridgeGuest implements WillCommand {
public GuestWillCommand(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void willCommand(Value body) {
this.bridge.guestExecuteVoid(this.guest, body);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestWillEnter.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.auth.Identity;
import swim.api.warp.function.WillEnter;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestWillEnter extends BridgeGuest implements WillEnter {
public GuestWillEnter(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void willEnter(Identity identity) {
this.bridge.guestExecuteVoid(this.guest, identity);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestWillLeave.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.auth.Identity;
import swim.api.warp.function.WillLeave;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestWillLeave extends BridgeGuest implements WillLeave {
public GuestWillLeave(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void willLeave(Identity identity) {
this.bridge.guestExecuteVoid(this.guest, identity);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/GuestWillUplink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.api.warp.function;
import swim.api.warp.WarpUplink;
import swim.api.warp.function.WillUplink;
import swim.dynamic.Bridge;
import swim.dynamic.BridgeGuest;
public class GuestWillUplink extends BridgeGuest implements WillUplink {
public GuestWillUplink(Bridge bridge, Object guest) {
super(bridge, guest);
}
@Override
public void willUplink(WarpUplink uplink) {
this.bridge.guestExecuteVoid(this.guest, uplink);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp | java-sources/ai/swim/swim-dynamic-api/3.10.0/swim/dynamic/api/warp/function/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.api.lane.function dynamic language bindings.
*/
package swim.dynamic.api.warp.function;
|
0 | java-sources/ai/swim/swim-dynamic-java | java-sources/ai/swim/swim-dynamic-java/3.10.0/module-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* java.base dynamic language bindings.
*/
module swim.dynamic.java {
requires transitive swim.dynamic;
exports swim.dynamic.java;
exports swim.dynamic.java.lang;
exports swim.dynamic.java.util;
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/JavaBase.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java;
import swim.dynamic.HostLibrary;
import swim.dynamic.JavaHostLibrary;
import swim.dynamic.java.lang.JavaLang;
import swim.dynamic.java.util.JavaUtil;
public final class JavaBase {
private JavaBase() {
// static
}
public static final HostLibrary LIBRARY;
static {
final JavaHostLibrary hostLib = new JavaHostLibrary("java.base");
LIBRARY = hostLib;
hostLib.addHostPackage(JavaLang.PACKAGE);
hostLib.addHostPackage(JavaUtil.PACKAGE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* java.base dynamic language bindings.
*/
package swim.dynamic.java;
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/lang/HostComparable.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.lang;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
public final class HostComparable {
private HostComparable() {
// static
}
public static final HostObjectType<Comparable<Object>> TYPE;
static {
final JavaHostObjectType<Comparable<Object>> type = new JavaHostObjectType<>(Comparable.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostComparableCompareTo());
}
}
final class HostComparableCompareTo implements HostMethod<Comparable<Object>> {
@Override
public String key() {
return "compareTo";
}
@Override
public Object invoke(Bridge bridge, Comparable<Object> comparable, Object... arguments) {
return comparable.compareTo(arguments[0]);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/lang/HostIterable.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.lang;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
public final class HostIterable {
private HostIterable() {
// static
}
public static final HostObjectType<Iterable<Object>> TYPE;
static {
final JavaHostObjectType<Iterable<Object>> type = new JavaHostObjectType<>(Iterable.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostIterableIterator());
}
}
final class HostIterableIterator implements HostMethod<Iterable<Object>> {
@Override
public String key() {
return "iterator";
}
@Override
public Object invoke(Bridge bridge, Iterable<Object> iterable, Object... arguments) {
return iterable.iterator();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/lang/HostObject.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.lang;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostBuiltinType;
public final class HostObject {
private HostObject() {
// static
}
public static final HostObjectType<Object> TYPE;
static {
final JavaHostBuiltinType<Object> type = new JavaHostBuiltinType<>(Object.class);
TYPE = type;
type.addMember(new HostObjectEquals());
type.addMember(new HostObjectHashCode());
type.addMember(new HostObjectToString());
}
}
final class HostObjectEquals implements HostMethod<Object> {
@Override
public String key() {
return "equals";
}
@Override
public Object invoke(Bridge bridge, Object object, Object... arguments) {
return object.equals(arguments[0]);
}
}
final class HostObjectHashCode implements HostMethod<Object> {
@Override
public String key() {
return "hashCode";
}
@Override
public Object invoke(Bridge bridge, Object object, Object... arguments) {
return object.hashCode();
}
}
final class HostObjectToString implements HostMethod<Object> {
@Override
public String key() {
return "toString";
}
@Override
public Object invoke(Bridge bridge, Object object, Object... arguments) {
return object.toString();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/lang/HostThrowable.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.lang;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
public final class HostThrowable {
private HostThrowable() {
// static
}
public static final HostObjectType<Throwable> TYPE;
static {
final JavaHostObjectType<Throwable> type = new JavaHostObjectType<>(Throwable.class);
TYPE = type;
type.extendType(HostObject.TYPE);
type.addMember(new HostThrowableGetMessage());
type.addMember(new HostThrowableGetCause());
}
}
final class HostThrowableGetMessage implements HostMethod<Throwable> {
@Override
public String key() {
return "getMessage";
}
@Override
public Object invoke(Bridge bridge, Throwable throwable, Object... arguments) {
return throwable.getMessage();
}
}
final class HostThrowableGetCause implements HostMethod<Throwable> {
@Override
public String key() {
return "getCause";
}
@Override
public Object invoke(Bridge bridge, Throwable throwable, Object... arguments) {
return throwable.getCause();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/lang/JavaLang.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.lang;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostPackage;
public final class JavaLang {
private JavaLang() {
// static
}
public static final HostPackage PACKAGE;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("java.lang");
PACKAGE = hostPkg;
hostPkg.addHostType(HostObject.TYPE);
hostPkg.addHostType(HostThrowable.TYPE);
hostPkg.addHostType(HostComparable.TYPE);
hostPkg.addHostType(HostIterable.TYPE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/lang/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* java.lang dynamic language bindings.
*/
package swim.dynamic.java.lang;
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/util/HostCollection.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.util;
import java.util.Collection;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostIterable;
public final class HostCollection {
private HostCollection() {
// static
}
public static final HostObjectType<Collection<Object>> TYPE;
static {
final JavaHostObjectType<Collection<Object>> type = new JavaHostObjectType<>(Collection.class);
TYPE = type;
type.inheritType(HostIterable.TYPE);
type.addMember(new HostCollectionIsEmpty());
}
}
final class HostCollectionIsEmpty implements HostMethod<Collection<Object>> {
@Override
public String key() {
return "isEmpty";
}
@Override
public Object invoke(Bridge bridge, Collection<Object> collection, Object... arguments) {
return collection.isEmpty();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/util/HostIterator.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.util;
import java.util.Iterator;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostIterator {
private HostIterator() {
// static
}
public static final HostObjectType<Iterator<Object>> TYPE;
static {
final JavaHostObjectType<Iterator<Object>> type = new JavaHostObjectType<>(Iterator.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostIteratorHasNext());
type.addMember(new HostIteratorNext());
type.addMember(new HostIteratorRemove());
}
}
final class HostIteratorHasNext implements HostMethod<Iterator<Object>> {
@Override
public String key() {
return "hasNext";
}
@Override
public Object invoke(Bridge bridge, Iterator<Object> iterator, Object... arguments) {
return iterator.hasNext();
}
}
final class HostIteratorNext implements HostMethod<Iterator<Object>> {
@Override
public String key() {
return "next";
}
@Override
public Object invoke(Bridge bridge, Iterator<Object> iterator, Object... arguments) {
return iterator.next();
}
}
final class HostIteratorRemove implements HostMethod<Iterator<Object>> {
@Override
public String key() {
return "remove";
}
@Override
public Object invoke(Bridge bridge, Iterator<Object> iterator, Object... arguments) {
iterator.remove();
return null;
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/util/HostList.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.util;
import java.util.List;
import swim.dynamic.Bridge;
import swim.dynamic.HostField;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
public final class HostList {
private HostList() {
// static
}
public static final HostObjectType<List<Object>> TYPE;
static {
final JavaHostObjectType<List<Object>> type = new JavaHostObjectType<>(List.class);
TYPE = type;
type.inheritType(HostCollection.TYPE);
type.addMember(new HostListlength());
}
}
final class HostListlength implements HostField<List<Object>> {
@Override
public String key() {
return "length";
}
@Override
public Object get(Bridge bridge, List<Object> list) {
return list.size();
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/util/HostMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.util;
import java.util.Map;
import swim.dynamic.Bridge;
import swim.dynamic.HostField;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.PolyglotHostObjectType;
import swim.dynamic.java.lang.HostObject;
public final class HostMap {
private HostMap() {
// static
}
public static final HostObjectType<Map<Object, Object>> TYPE;
static {
final PolyglotHostObjectType<Map<Object, Object>> type = new PolyglotHostObjectType<>(Map.class);
TYPE = type;
type.inheritType(HostObject.TYPE);
type.addMember(new HostMapIsEmpty());
type.addMember(new HostMapSize());
type.addSpecializedMember("js", new HostMapJsHas());
type.addUnspecializedMember(new HostMapContainsKey());
}
}
final class HostMapIsEmpty implements HostMethod<Map<Object, Object>> {
@Override
public String key() {
return "isEmpty";
}
@Override
public Object invoke(Bridge bridge, Map<Object, Object> map, Object... arguments) {
return map.isEmpty();
}
}
final class HostMapSize implements HostField<Map<Object, Object>> {
@Override
public String key() {
return "size";
}
@Override
public Object get(Bridge bridge, Map<Object, Object> map) {
return map.size();
}
}
final class HostMapJsHas implements HostMethod<Map<Object, Object>> {
@Override
public String key() {
return "has";
}
@Override
public Object invoke(Bridge bridge, Map<Object, Object> map, Object... arguments) {
return map.containsKey(arguments[0]);
}
}
final class HostMapContainsKey implements HostMethod<Map<Object, Object>> {
@Override
public String key() {
return "containsKey";
}
@Override
public Object invoke(Bridge bridge, Map<Object, Object> map, Object... arguments) {
return map.containsKey(arguments[0]);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/util/JavaUtil.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.java.util;
import swim.dynamic.HostPackage;
import swim.dynamic.JavaHostPackage;
public final class JavaUtil {
private JavaUtil() {
// static
}
public static final HostPackage PACKAGE;
static {
final JavaHostPackage hostPkg = new JavaHostPackage("java.util");
PACKAGE = hostPkg;
hostPkg.addHostType(HostIterator.TYPE);
hostPkg.addHostType(HostCollection.TYPE);
hostPkg.addHostType(HostList.TYPE);
hostPkg.addHostType(HostMap.TYPE);
}
}
|
0 | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java | java-sources/ai/swim/swim-dynamic-java/3.10.0/swim/dynamic/java/util/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* java.util dynamic language bindings.
*/
package swim.dynamic.java.util;
|
0 | java-sources/ai/swim/swim-dynamic-observable | java-sources/ai/swim/swim-dynamic-observable/3.10.0/module-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* swim.observable dynamic language bindings.
*/
module swim.dynamic.observable {
requires transitive swim.observable;
requires transitive swim.dynamic;
requires transitive swim.dynamic.java;
exports swim.dynamic.observable;
}
|
0 | java-sources/ai/swim/swim-dynamic-observable/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-observable/3.10.0/swim/dynamic/observable/HostObservableList.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.observable;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
import swim.dynamic.observable.function.GuestDidClear;
import swim.dynamic.observable.function.GuestDidDrop;
import swim.dynamic.observable.function.GuestDidMoveIndex;
import swim.dynamic.observable.function.GuestDidRemoveIndex;
import swim.dynamic.observable.function.GuestDidTake;
import swim.dynamic.observable.function.GuestDidUpdateIndex;
import swim.dynamic.observable.function.GuestWillClear;
import swim.dynamic.observable.function.GuestWillDrop;
import swim.dynamic.observable.function.GuestWillMoveIndex;
import swim.dynamic.observable.function.GuestWillRemoveIndex;
import swim.dynamic.observable.function.GuestWillTake;
import swim.dynamic.observable.function.GuestWillUpdateIndex;
import swim.observable.ObservableList;
public final class HostObservableList {
private HostObservableList() {
// static
}
public static final HostObjectType<ObservableList<Object>> TYPE;
static {
final JavaHostObjectType<ObservableList<Object>> type = new JavaHostObjectType<>(ObservableList.class);
TYPE = type;
type.inheritType(HostObject.TYPE); // FIXME: replace with type.inheritType(HostList.TYPE);
type.addMember(new HostObservableListDrop());
type.addMember(new HostObservableListTake());
type.addMember(new HostObservableListMove());
type.addMember(new HostObservableListWillUpdate());
type.addMember(new HostObservableListDidUpdate());
type.addMember(new HostObservableListWillMove());
type.addMember(new HostObservableListDidMove());
type.addMember(new HostObservableListWillRemove());
type.addMember(new HostObservableListDidRemove());
type.addMember(new HostObservableListWillDrop());
type.addMember(new HostObservableListDidDrop());
type.addMember(new HostObservableListWillTake());
type.addMember(new HostObservableListDidTake());
type.addMember(new HostObservableListWillClear());
type.addMember(new HostObservableListDidClear());
}
}
final class HostObservableListDrop implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "drop";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
observable.drop((int) arguments[0]);
return null;
}
}
final class HostObservableListTake implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "take";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
observable.take((int) arguments[0]);
return null;
}
}
final class HostObservableListMove implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "move";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
observable.move((int) arguments[0], (int) arguments[1]);
return null;
}
}
final class HostObservableListWillUpdate implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "willUpdate";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.willUpdate(new GuestWillUpdateIndex<Object>(bridge, arguments[0]));
}
}
final class HostObservableListDidUpdate implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "didUpdate";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.didUpdate(new GuestDidUpdateIndex<Object>(bridge, arguments[0]));
}
}
final class HostObservableListWillMove implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "willMove";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.willMove(new GuestWillMoveIndex<Object>(bridge, arguments[0]));
}
}
final class HostObservableListDidMove implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "didMove";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.didMove(new GuestDidMoveIndex<Object>(bridge, arguments[0]));
}
}
final class HostObservableListWillRemove implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "willRemove";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.willRemove(new GuestWillRemoveIndex(bridge, arguments[0]));
}
}
final class HostObservableListDidRemove implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "didRemove";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.didRemove(new GuestDidRemoveIndex<Object>(bridge, arguments[0]));
}
}
final class HostObservableListWillDrop implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "willDrop";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.willDrop(new GuestWillDrop(bridge, arguments[0]));
}
}
final class HostObservableListDidDrop implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "didDrop";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.didDrop(new GuestDidDrop(bridge, arguments[0]));
}
}
final class HostObservableListWillTake implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "willTake";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.willTake(new GuestWillTake(bridge, arguments[0]));
}
}
final class HostObservableListDidTake implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "didTake";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.didTake(new GuestDidTake(bridge, arguments[0]));
}
}
final class HostObservableListWillClear implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "willClear";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.willClear(new GuestWillClear(bridge, arguments[0]));
}
}
final class HostObservableListDidClear implements HostMethod<ObservableList<Object>> {
@Override
public String key() {
return "didClear";
}
@Override
public Object invoke(Bridge bridge, ObservableList<Object> observable, Object... arguments) {
return observable.didClear(new GuestDidClear(bridge, arguments[0]));
}
}
|
0 | java-sources/ai/swim/swim-dynamic-observable/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-observable/3.10.0/swim/dynamic/observable/HostObservableMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.observable;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.java.lang.HostObject;
import swim.dynamic.observable.function.GuestDidClear;
import swim.dynamic.observable.function.GuestDidRemoveKey;
import swim.dynamic.observable.function.GuestDidUpdateKey;
import swim.dynamic.observable.function.GuestWillClear;
import swim.dynamic.observable.function.GuestWillRemoveKey;
import swim.dynamic.observable.function.GuestWillUpdateKey;
import swim.observable.ObservableMap;
public final class HostObservableMap {
private HostObservableMap() {
// static
}
public static final HostObjectType<ObservableMap<Object, Object>> TYPE;
static {
final JavaHostObjectType<ObservableMap<Object, Object>> type = new JavaHostObjectType<>(ObservableMap.class);
TYPE = type;
type.inheritType(HostObject.TYPE); // FIXME: replace with type.inheritType(HostMap.TYPE);
type.addMember(new HostObservableMapWillUpdate());
type.addMember(new HostObservableMapDidUpdate());
type.addMember(new HostObservableMapWillRemove());
type.addMember(new HostObservableMapDidRemove());
type.addMember(new HostObservableMapWillClear());
type.addMember(new HostObservableMapDidClear());
}
}
final class HostObservableMapWillUpdate implements HostMethod<ObservableMap<Object, Object>> {
@Override
public String key() {
return "willUpdate";
}
@Override
public Object invoke(Bridge bridge, ObservableMap<Object, Object> observable, Object... arguments) {
return observable.willUpdate(new GuestWillUpdateKey<Object, Object>(bridge, arguments[0]));
}
}
final class HostObservableMapDidUpdate implements HostMethod<ObservableMap<Object, Object>> {
@Override
public String key() {
return "didUpdate";
}
@Override
public Object invoke(Bridge bridge, ObservableMap<Object, Object> observable, Object... arguments) {
return observable.didUpdate(new GuestDidUpdateKey<Object, Object>(bridge, arguments[0]));
}
}
final class HostObservableMapWillRemove implements HostMethod<ObservableMap<Object, Object>> {
@Override
public String key() {
return "willRemove";
}
@Override
public Object invoke(Bridge bridge, ObservableMap<Object, Object> observable, Object... arguments) {
return observable.willRemove(new GuestWillRemoveKey<Object>(bridge, arguments[0]));
}
}
final class HostObservableMapDidRemove implements HostMethod<ObservableMap<Object, Object>> {
@Override
public String key() {
return "didRemove";
}
@Override
public Object invoke(Bridge bridge, ObservableMap<Object, Object> observable, Object... arguments) {
return observable.didRemove(new GuestDidRemoveKey<Object, Object>(bridge, arguments[0]));
}
}
final class HostObservableMapWillClear implements HostMethod<ObservableMap<Object, Object>> {
@Override
public String key() {
return "willClear";
}
@Override
public Object invoke(Bridge bridge, ObservableMap<Object, Object> observable, Object... arguments) {
return observable.willClear(new GuestWillClear(bridge, arguments[0]));
}
}
final class HostObservableMapDidClear implements HostMethod<ObservableMap<Object, Object>> {
@Override
public String key() {
return "didClear";
}
@Override
public Object invoke(Bridge bridge, ObservableMap<Object, Object> observable, Object... arguments) {
return observable.didClear(new GuestDidClear(bridge, arguments[0]));
}
}
|
0 | java-sources/ai/swim/swim-dynamic-observable/3.10.0/swim/dynamic | java-sources/ai/swim/swim-dynamic-observable/3.10.0/swim/dynamic/observable/HostObservableSortedMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.dynamic.observable;
import swim.dynamic.Bridge;
import swim.dynamic.HostMethod;
import swim.dynamic.HostObjectType;
import swim.dynamic.JavaHostObjectType;
import swim.dynamic.observable.function.GuestDidDrop;
import swim.dynamic.observable.function.GuestDidTake;
import swim.dynamic.observable.function.GuestWillDrop;
import swim.dynamic.observable.function.GuestWillTake;
import swim.observable.ObservableSortedMap;
public final class HostObservableSortedMap {
private HostObservableSortedMap() {
// static
}
public static final HostObjectType<ObservableSortedMap<Object, Object>> TYPE;
static {
final JavaHostObjectType<ObservableSortedMap<Object, Object>> type = new JavaHostObjectType<>(ObservableSortedMap.class);
TYPE = type;
type.inheritType(HostObservableMap.TYPE);
// FIXME: type.inheritType(HostSortedMap.TYPE);
type.addMember(new HostObservableSortedMapDrop());
type.addMember(new HostObservableSortedMapTake());
type.addMember(new HostObservableSortedMapWillDrop());
type.addMember(new HostObservableSortedMapDidDrop());
type.addMember(new HostObservableSortedMapWillTake());
type.addMember(new HostObservableSortedMapDidTake());
}
}
final class HostObservableSortedMapDrop implements HostMethod<ObservableSortedMap<Object, Object>> {
@Override
public String key() {
return "drop";
}
@Override
public Object invoke(Bridge bridge, ObservableSortedMap<Object, Object> observable, Object... arguments) {
observable.drop((int) arguments[0]);
return null;
}
}
final class HostObservableSortedMapTake implements HostMethod<ObservableSortedMap<Object, Object>> {
@Override
public String key() {
return "take";
}
@Override
public Object invoke(Bridge bridge, ObservableSortedMap<Object, Object> observable, Object... arguments) {
observable.take((int) arguments[0]);
return null;
}
}
final class HostObservableSortedMapWillDrop implements HostMethod<ObservableSortedMap<Object, Object>> {
@Override
public String key() {
return "willDrop";
}
@Override
public Object invoke(Bridge bridge, ObservableSortedMap<Object, Object> observable, Object... arguments) {
return observable.willDrop(new GuestWillDrop(bridge, arguments[0]));
}
}
final class HostObservableSortedMapDidDrop implements HostMethod<ObservableSortedMap<Object, Object>> {
@Override
public String key() {
return "didDrop";
}
@Override
public Object invoke(Bridge bridge, ObservableSortedMap<Object, Object> observable, Object... arguments) {
return observable.didDrop(new GuestDidDrop(bridge, arguments[0]));
}
}
final class HostObservableSortedMapWillTake implements HostMethod<ObservableSortedMap<Object, Object>> {
@Override
public String key() {
return "willTake";
}
@Override
public Object invoke(Bridge bridge, ObservableSortedMap<Object, Object> observable, Object... arguments) {
return observable.willTake(new GuestWillTake(bridge, arguments[0]));
}
}
final class HostObservableSortedMapDidTake implements HostMethod<ObservableSortedMap<Object, Object>> {
@Override
public String key() {
return "didTake";
}
@Override
public Object invoke(Bridge bridge, ObservableSortedMap<Object, Object> observable, Object... arguments) {
return observable.didTake(new GuestDidTake(bridge, arguments[0]));
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.