当前位置: 首页>>代码示例>>Java>>正文


Java TFloatList类代码示例

本文整理汇总了Java中gnu.trove.list.TFloatList的典型用法代码示例。如果您正苦于以下问题:Java TFloatList类的具体用法?Java TFloatList怎么用?Java TFloatList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TFloatList类属于gnu.trove.list包,在下文中一共展示了TFloatList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: subList

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
  public TFloatList subList( int begin, int end ) {
  	if ( end < begin ) {
	throw new IllegalArgumentException( "end index " + end +
		" greater than begin index " + begin );
}
if ( begin < 0 ) {
	throw new IndexOutOfBoundsException( "begin index can not be < 0" );
}
if ( end > _data.length ) {
	throw new IndexOutOfBoundsException( "end index < " + _data.length );
}
      TFloatArrayList list = new TFloatArrayList( end - begin );
      for ( int i = begin; i < end; i++ ) {
      	list.add( _data[ i ] );
      }
      return list;
  }
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:19,代码来源:TFloatArrayList.java

示例2: subList

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
public TFloatList subList(int begin, int end) {
    if (end < begin) {
        throw new IllegalArgumentException("begin index " + begin +
                " greater than end index " + end);
    }
    if (size < begin) {
        throw new IllegalArgumentException("begin index " + begin +
                " greater than last index " + size);
    }
    if (begin < 0) {
        throw new IndexOutOfBoundsException("begin index can not be < 0");
    }
    if (end > size) {
        throw new IndexOutOfBoundsException("end index < " + size);
    }

    TFloatLinkedList ret = new TFloatLinkedList();
    TFloatLink tmp = getLinkAt(begin);
    for (int i = begin; i < end; i++) {
        ret.add(tmp.getValue()); // copy
        tmp = tmp.getNext();
    }

    return ret;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:27,代码来源:TFloatLinkedList.java

示例3: equals

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( other == this ) {
        return true;
    }
    if ( !( other instanceof TFloatList ) ) return false;

    TFloatList that = ( TFloatList )other;
    if ( size() != that.size() ) return false;

    for( int i = 0; i < size(); i++ ) {
        if ( get( i ) != that.get( i ) ) {
            return false;
        }
    }
    return true;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:19,代码来源:TFloatLinkedList.java

示例4: subList

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
  @Override
  public TFloatList subList( int begin, int end ) {
  	if ( end < begin ) {
	throw new IllegalArgumentException( "end index " + end +
		" greater than begin index " + begin );
}
if ( begin < 0 ) {
	throw new IndexOutOfBoundsException( "begin index can not be < 0" );
}
if ( end > _data.length ) {
	throw new IndexOutOfBoundsException( "end index < " + _data.length );
}
      TFloatArrayList list = new TFloatArrayList( end - begin );
      for ( int i = begin; i < end; i++ ) {
      	list.add( _data[ i ] );
      }
      return list;
  }
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:20,代码来源:TFloatArrayList.java

示例5: load

import gnu.trove.list.TFloatList; //导入依赖的package包/类
public static VertexArray load(GLContext context, Path path) {
	try {
		// Create the lists to store the vertex data
		final TFloatList positions = new TFloatArrayList();
		final TFloatList texcoords = new TFloatArrayList();
		final TFloatList normals = new TFloatArrayList();
		final TIntList indices = new TIntArrayList();
		// Load the raw vertex data into the lists
		load(Files.lines(path), positions, texcoords, normals, indices);
		// Calculate the normals if the model does not have any
		if (normals.isEmpty()) {
			calculateNormals(positions, indices, normals);
		}
		// Create the vertex array object
		final VertexArray mesh = context.newVertexArray();
		mesh.create();
		mesh.setIndices(indices);
		mesh.addAttribute(0, POSITION_SIZE, positions);
		mesh.addAttribute(1, TEXCOORD_SIZE, texcoords);
		mesh.addAttribute(2, NORMAL_SIZE, normals);
		return mesh;
	} catch (IOException ex) {
		throw new IllegalArgumentException("Unable to load mesh: " + path, ex);
	}
}
 
开发者ID:thehutch,项目名称:Fusion,代码行数:26,代码来源:WavefrontOBJLoader.java

示例6: set

import gnu.trove.list.TFloatList; //导入依赖的package包/类
public void set(final TFloatList value) {
    final Command command = new Command(Command.SETALL, (short) value.size());
    commands.add(command);
    ++baselineCommandCount;

    //Is this the best way to do this?
    v.clear();
    v.addAll(value);

    for (int i = 0, size = value.size(); i < size; ++i) {
        final Command subCommand = new Command(Command.SET, (short) i, value.get(i));
        commands.add(subCommand);
        ++baselineCommandCount;
    }

    touch();
    onChanged();
}
 
开发者ID:bacta,项目名称:pre-cu,代码行数:19,代码来源:AutoDeltaFloatVector.java

示例7: calculateAABB

import gnu.trove.list.TFloatList; //导入依赖的package包/类
private static AABB calculateAABB(TFloatList vertices, int vertexCount) {
    if (vertexCount == 0) {
        return AABB.createEmpty();
    }

    Vector3f min = new Vector3f(vertices.get(0), vertices.get(1), vertices.get(2));
    Vector3f max = new Vector3f(vertices.get(0), vertices.get(1), vertices.get(2));
    for (int index = 1; index < vertexCount; ++index) {
        min.x = Math.min(min.x, vertices.get(3 * index));
        max.x = Math.max(max.x, vertices.get(3 * index));
        min.y = Math.min(min.y, vertices.get(3 * index + 1));
        max.y = Math.max(max.y, vertices.get(3 * index + 1));
        min.z = Math.min(min.z, vertices.get(3 * index + 2));
        max.z = Math.max(max.z, vertices.get(3 * index + 2));
    }
    return AABB.createMinMax(min, max);

}
 
开发者ID:zoneXcoding,项目名称:Mineworld,代码行数:19,代码来源:Mesh.java

示例8: grep

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
public TFloatList grep( TFloatProcedure condition ) {
    TFloatArrayList list = new TFloatArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TFloatArrayList.java

示例9: inverseGrep

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
public TFloatList inverseGrep( TFloatProcedure condition ) {
    TFloatArrayList list = new TFloatArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( !condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TFloatArrayList.java

示例10: TFloatLinkedList

import gnu.trove.list.TFloatList; //导入依赖的package包/类
public TFloatLinkedList(TFloatList list) {
    no_entry_value = list.getNoEntryValue();
    //
    for (TFloatIterator iterator = list.iterator(); iterator.hasNext();) {
        float next = iterator.next();
        add(next);
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:9,代码来源:TFloatLinkedList.java

示例11: sort

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
public void sort(int fromIndex, int toIndex) {
    TFloatList tmp = subList(fromIndex, toIndex);
    float[] vals = tmp.toArray();
    Arrays.sort(vals);
    set(fromIndex, vals);
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:8,代码来源:TFloatLinkedList.java

示例12: grep

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
public TFloatList grep(TFloatProcedure condition) {
    TFloatList ret = new TFloatLinkedList();
    for (TFloatLink l = head; got(l); l = l.getNext()) {
        if (condition.execute(l.getValue()))
            ret.add(l.getValue());
    }
    return ret;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TFloatLinkedList.java

示例13: inverseGrep

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
public TFloatList inverseGrep(TFloatProcedure condition) {
    TFloatList ret = new TFloatLinkedList();
    for (TFloatLink l = head; got(l); l = l.getNext()) {
        if (!condition.execute(l.getValue()))
            ret.add(l.getValue());
    }
    return ret;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TFloatLinkedList.java

示例14: readExternal

import gnu.trove.list.TFloatList; //导入依赖的package包/类
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // LIST
    list = ( TFloatList ) in.readObject();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TFloatListDecorator.java

示例15: grep

import gnu.trove.list.TFloatList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TFloatList grep( TFloatProcedure condition ) {
    TFloatArrayList list = new TFloatArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TFloatArrayList.java


注:本文中的gnu.trove.list.TFloatList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。