本文整理汇总了Java中gnu.trove.list.TCharList类的典型用法代码示例。如果您正苦于以下问题:Java TCharList类的具体用法?Java TCharList怎么用?Java TCharList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TCharList类属于gnu.trove.list包,在下文中一共展示了TCharList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: subList
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public TCharList 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 );
}
TCharArrayList list = new TCharArrayList( end - begin );
for ( int i = begin; i < end; i++ ) {
list.add( _data[ i ] );
}
return list;
}
示例2: subList
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public TCharList 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);
}
TCharLinkedList ret = new TCharLinkedList();
TCharLink tmp = getLinkAt(begin);
for (int i = begin; i < end; i++) {
ret.add(tmp.getValue()); // copy
tmp = tmp.getNext();
}
return ret;
}
示例3: equals
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
if ( other == this ) {
return true;
}
if ( !( other instanceof TCharList ) ) return false;
TCharList that = ( TCharList )other;
if ( size() != that.size() ) return false;
for( int i = 0; i < size(); i++ ) {
if ( get( i ) != that.get( i ) ) {
return false;
}
}
return true;
}
示例4: subList
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TCharList 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 );
}
TCharArrayList list = new TCharArrayList( end - begin );
for ( int i = begin; i < end; i++ ) {
list.add( _data[ i ] );
}
return list;
}
示例5: get
import gnu.trove.list.TCharList; //导入依赖的package包/类
@Override
public TIntIterator get(final int item) {
final TCharList l = this.occurrences.get(item);
if (l == null) {
throw new IllegalArgumentException("item " + item + " has no tidlist");
} else {
final TCharIterator iter = l.iterator();
return new TIntIterator() {
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@Override
public boolean hasNext() {
return iter.hasNext();
}
@Override
public int next() {
return iter.next();
}
};
}
}
示例6: grep
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public TCharList grep( TCharProcedure condition ) {
TCharArrayList list = new TCharArrayList();
for ( int i = 0; i < _pos; i++ ) {
if ( condition.execute( _data[ i ] ) ) {
list.add( _data[ i ] );
}
}
return list;
}
示例7: inverseGrep
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public TCharList inverseGrep( TCharProcedure condition ) {
TCharArrayList list = new TCharArrayList();
for ( int i = 0; i < _pos; i++ ) {
if ( !condition.execute( _data[ i ] ) ) {
list.add( _data[ i ] );
}
}
return list;
}
示例8: TCharLinkedList
import gnu.trove.list.TCharList; //导入依赖的package包/类
public TCharLinkedList(TCharList list) {
no_entry_value = list.getNoEntryValue();
//
for (TCharIterator iterator = list.iterator(); iterator.hasNext();) {
char next = iterator.next();
add(next);
}
}
示例9: sort
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public void sort(int fromIndex, int toIndex) {
TCharList tmp = subList(fromIndex, toIndex);
char[] vals = tmp.toArray();
Arrays.sort(vals);
set(fromIndex, vals);
}
示例10: grep
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public TCharList grep(TCharProcedure condition) {
TCharList ret = new TCharLinkedList();
for (TCharLink l = head; got(l); l = l.getNext()) {
if (condition.execute(l.getValue()))
ret.add(l.getValue());
}
return ret;
}
示例11: inverseGrep
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
public TCharList inverseGrep(TCharProcedure condition) {
TCharList ret = new TCharLinkedList();
for (TCharLink l = head; got(l); l = l.getNext()) {
if (!condition.execute(l.getValue()))
ret.add(l.getValue());
}
return ret;
}
示例12: readExternal
import gnu.trove.list.TCharList; //导入依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// LIST
list = ( TCharList ) in.readObject();
}
示例13: grep
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TCharList grep( TCharProcedure condition ) {
TCharArrayList list = new TCharArrayList();
for ( int i = 0; i < _pos; i++ ) {
if ( condition.execute( _data[ i ] ) ) {
list.add( _data[ i ] );
}
}
return list;
}
示例14: inverseGrep
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TCharList inverseGrep( TCharProcedure condition ) {
TCharArrayList list = new TCharArrayList();
for ( int i = 0; i < _pos; i++ ) {
if ( !condition.execute( _data[ i ] ) ) {
list.add( _data[ i ] );
}
}
return list;
}
示例15: subList
import gnu.trove.list.TCharList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TCharList 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);
}
TCharLinkedList ret = new TCharLinkedList();
TCharLink tmp = getLinkAt(begin);
for (int i = begin; i < end; i++) {
ret.add(tmp.getValue()); // copy
tmp = tmp.getNext();
}
return ret;
}