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

com.orientechnologies.spatial.shape.legacy.OShapeBuilderLegacyImpl Maven / Gradle / Ivy

There is a newer version: 2.2.37
Show newest version
package com.orientechnologies.spatial.shape.legacy;

import com.orientechnologies.orient.core.index.OCompositeKey;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.shape.Shape;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Enrico Risa on 23/10/15.
 */
public class OShapeBuilderLegacyImpl implements OShapeBuilderLegacy {

  List             builders = new ArrayList();

  public static OShapeBuilderLegacyImpl INSTANCE = new OShapeBuilderLegacyImpl();

  protected OShapeBuilderLegacyImpl() {
    builders.add(new OPointLegecyBuilder());
    builders.add(new ORectangleLegacyBuilder());
  }

  @Override
  public Shape makeShape(OCompositeKey key, SpatialContext ctx) {
    for (OShapeBuilderLegacy f : builders) {
      if (f.canHandle(key)) {
        return f.makeShape(key, ctx);
      }
    }
    return null;
  }

  @Override
  public boolean canHandle(OCompositeKey key) {
    return false;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy