Android Open Source - android-plotter Plot Data






From Project

Back to project page android-plotter.

License

The source code is released under:

Apache License

If you think the Android project android-plotter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright 2013 serso aka se.solovyev// w  ww  .ja va  2s.  c om
 *
 * 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.
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Contact details
 *
 * Email: se.solovyev@gmail.com
 * Site:  http://se.solovyev.org
 */

package org.solovyev.android.plotter;

import android.text.TextUtils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;

public final class PlotData {

  @Nonnull
  public AxisStyle axisStyle = AxisStyle.create();

  @Nonnull
  public final List<PlotFunction> functions = new ArrayList<PlotFunction>();

  private PlotData() {
  }

  @Nonnull
  public static PlotData create() {
    Check.isMainThread();
    return new PlotData();
  }

  @Nonnull
  public PlotData copy() {
    Check.isMainThread();
    final PlotData copy = create();

    copy.axisStyle = axisStyle.copy();
    for (PlotFunction function : functions) {
      copy.functions.add(function.copy());
    }

    return copy;
  }

  public void add(@Nonnull PlotFunction function) {
    Check.isMainThread();
    if (!update(function)) {
      functions.add(function);
    }
  }

  boolean update(@Nonnull PlotFunction function) {
    Check.isMainThread();
    for (int i = 0; i < functions.size(); i++) {
      final PlotFunction oldFunction = functions.get(i);
      if (oldFunction.function == function.function) {
        functions.set(i, function);
        return true;
      }
    }
    return false;
  }

  public void add(@Nonnull Function function) {
    add(PlotFunction.create(function));
  }

  @Nullable
  public PlotFunction get(@Nonnull String name) {
    for (PlotFunction function : functions) {
      if (TextUtils.equals(function.function.getName(), name)) {
        return function;
      }
    }
    return null;
  }
}




Java Source Code List

com.android.texample.GLText.java
com.android.texample.SpriteBatch.java
com.android.texample.TexampleRenderer.java
com.android.texample.TextureRegion.java
com.android.texample.Vertices.java
org.solovyev.android.plotter.Angle.java
org.solovyev.android.plotter.AxisStyle.java
org.solovyev.android.plotter.Check.java
org.solovyev.android.plotter.Color.java
org.solovyev.android.plotter.DefaultPlotter.java
org.solovyev.android.plotter.Dimensions.java
org.solovyev.android.plotter.Frustum.java
org.solovyev.android.plotter.Function0.java
org.solovyev.android.plotter.Function1.java
org.solovyev.android.plotter.Function2.java
org.solovyev.android.plotter.Function.java
org.solovyev.android.plotter.LineStyle.java
org.solovyev.android.plotter.MeshConfig.java
org.solovyev.android.plotter.MultisampleConfigChooser.java
org.solovyev.android.plotter.PinchZoomTracker.java
org.solovyev.android.plotter.PlotData.java
org.solovyev.android.plotter.PlotFunction.java
org.solovyev.android.plotter.PlotRenderer.java
org.solovyev.android.plotter.PlotView.java
org.solovyev.android.plotter.Plot.java
org.solovyev.android.plotter.Plotter.java
org.solovyev.android.plotter.PlottingView.java
org.solovyev.android.plotter.Spf.java
org.solovyev.android.plotter.SuperFunction.java
org.solovyev.android.plotter.TouchHandler.java
org.solovyev.android.plotter.ZoomLevels.java
org.solovyev.android.plotter.Zoomer.java
org.solovyev.android.plotter.app.MainActivity.java
org.solovyev.android.plotter.app.PlotterApplication.java
org.solovyev.android.plotter.meshes.Arrays.java
org.solovyev.android.plotter.meshes.AxisGrid.java
org.solovyev.android.plotter.meshes.Axis.java
org.solovyev.android.plotter.meshes.BaseCube.java
org.solovyev.android.plotter.meshes.BaseCurve.java
org.solovyev.android.plotter.meshes.BaseMesh.java
org.solovyev.android.plotter.meshes.BaseSurface.java
org.solovyev.android.plotter.meshes.DimensionsAwareSwapper.java
org.solovyev.android.plotter.meshes.DimensionsAware.java
org.solovyev.android.plotter.meshes.DoubleBufferGroup.java
org.solovyev.android.plotter.meshes.DoubleBufferMesh.java
org.solovyev.android.plotter.meshes.FunctionGraph2d.java
org.solovyev.android.plotter.meshes.FunctionGraph3d.java
org.solovyev.android.plotter.meshes.FunctionGraphSwapper.java
org.solovyev.android.plotter.meshes.FunctionGraph.java
org.solovyev.android.plotter.meshes.Graph.java
org.solovyev.android.plotter.meshes.Group.java
org.solovyev.android.plotter.meshes.IndicesOrder.java
org.solovyev.android.plotter.meshes.ListGroup.java
org.solovyev.android.plotter.meshes.ListPool.java
org.solovyev.android.plotter.meshes.Mesh.java
org.solovyev.android.plotter.meshes.Meshes.java
org.solovyev.android.plotter.meshes.Pool.java
org.solovyev.android.plotter.meshes.Scene.java
org.solovyev.android.plotter.meshes.SolidCube.java
org.solovyev.android.plotter.meshes.SurfaceInitializer.java
org.solovyev.android.plotter.meshes.WireFrameCube.java