/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.frostwire.jlibtorrent.swig; public class block_info { private long swigCPtr; protected boolean swigCMemOwn; protected block_info(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(block_info obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; libtorrent_jni.delete_block_info(swigCPtr); } swigCPtr = 0; } } public void set_peer(tcp_endpoint ep) { libtorrent_jni.block_info_set_peer(swigCPtr, this, tcp_endpoint.getCPtr(ep), ep); } public void setBytes_progress(long value) { libtorrent_jni.block_info_bytes_progress_set(swigCPtr, this, value); } public long getBytes_progress() { return libtorrent_jni.block_info_bytes_progress_get(swigCPtr, this); } public void setBlock_size(long value) { libtorrent_jni.block_info_block_size_set(swigCPtr, this, value); } public long getBlock_size() { return libtorrent_jni.block_info_block_size_get(swigCPtr, this); } public void setState(long value) { libtorrent_jni.block_info_state_set(swigCPtr, this, value); } public long getState() { return libtorrent_jni.block_info_state_get(swigCPtr, this); } public void setNum_peers(long value) { libtorrent_jni.block_info_num_peers_set(swigCPtr, this, value); } public long getNum_peers() { return libtorrent_jni.block_info_num_peers_get(swigCPtr, this); } public block_info() { this(libtorrent_jni.new_block_info(), true); } public enum block_state_t { none, requested, writing, finished; public final int swigValue() { return swigValue; } public static block_state_t swigToEnum(int swigValue) { block_state_t[] swigValues = block_state_t.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (block_state_t swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + block_state_t.class + " with value " + swigValue); } @SuppressWarnings("unused") private block_state_t() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private block_state_t(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private block_state_t(block_state_t swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } } }