All Downloads are FREE. Search and download functionalities are using the official Maven repository.

manifold.api.highjump.Highjump Maven / Gradle / Ivy

There is a newer version: 2024.1.42
Show newest version
/*
 * Copyright (c) 2019 - Manifold Systems LLC
 *
 * 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 manifold.api.highjump;

import manifold.api.type.ITypeManifold;
import manifold.internal.host.RuntimeManifoldHost;

public class Highjump
{
  private static final Highjump INSTANCE = new Highjump();
  private final HighjumpTypeManifold _highjump;

  public static Highjump instance()
  {
    return INSTANCE;
  }

  private Highjump()
  {
    for( ITypeManifold tm: RuntimeManifoldHost.get().getSingleModule().getTypeManifolds() )
    {
      if( tm instanceof HighjumpTypeManifold )
      {
        _highjump = (HighjumpTypeManifold)tm;
        return;
      }
    }
    throw new IllegalStateException( "Type manifold for '" + HighjumpTypeManifold.class.getTypeName() + "' not found." );
  }

  public Object evaluate( String expr )
  {
    return evaluate( Options.builder( expr ).build() );
  }
  public Object evaluate( Options options )
  {
    Object result = _highjump.evaluate( options );
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy