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

com.tenio.common.data.zero.ZeroArray Maven / Gradle / Ivy

Go to download

TenIO is a java NIO (Non-blocking I/O) based server specifically designed for multiplayer games. It supports UDP and TCP transports which are handled by Netty for high-speed network transmission. This is the common module for multipurpose use of the framework.

There is a newer version: 0.6.0
Show newest version
/*
The MIT License

Copyright (c) 2016-2022 kong 

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

package com.tenio.common.data.zero;

import java.util.Collection;

/**
 * This class holds sequence elements.
 */
public interface ZeroArray extends ReadonlyZeroArray, Iterable {

  /**
   * Removes an element at an integer index.
   *
   * @param index the index of element should be removed
   */
  void removeElementAt(int index);

  /**
   * Appends a null value into the array.
   *
   * @return the pointer of this instance
   */
  ZeroArray addNull();

  /**
   * Appends a boolean value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addBoolean(boolean data);

  /**
   * Appends a byte value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addByte(byte data);

  /**
   * Appends a short value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addShort(short data);

  /**
   * Appends a integer value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addInteger(int data);

  /**
   * Appends a long value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addLong(long data);

  /**
   * Appends a float value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addFloat(float data);

  /**
   * Appends a double value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addDouble(double data);

  /**
   * Appends a {@link String} value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addString(String data);

  /**
   * Appends a {@link ZeroArray} value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addZeroArray(ZeroArray data);

  /**
   * Appends a {@link ZeroMap} value into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   */
  ZeroArray addZeroMap(ZeroMap data);

  /**
   * Appends a {@link ZeroElement} into the array.
   *
   * @param element the appended data
   * @return the pointer of this instance
   */
  ZeroArray addZeroElement(ZeroElement element);

  /**
   * Appends a collection of {@link Boolean} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addBooleanArray(Collection data);

  /**
   * Appends an array of binaries into the array.
   *
   * @param data the appended byte[] data
   * @return the pointer of this instance
   */
  ZeroArray addByteArray(byte[] data);

  /**
   * Appends a collection of {@link Short} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addShortArray(Collection data);

  /**
   * Appends a collection of {@link Integer} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addIntegerArray(Collection data);

  /**
   * Appends a collection of {@link Long} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addLongArray(Collection data);

  /**
   * Appends a collection of {@link Float} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addFloatArray(Collection data);

  /**
   * Appends a collection of {@link Double} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addDoubleArray(Collection data);

  /**
   * Appends a collection of {@link String} values into the array.
   *
   * @param data the appended data
   * @return the pointer of this instance
   * @see Collection
   */
  ZeroArray addStringArray(Collection data);

  /**
   * Retrieves a new array in read-only mode.
   *
   * @return a read-only array {@link ReadonlyZeroArray}
   */
  ReadonlyZeroArray getReadonlyZeroArray();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy