github.com/searKing/golang/go@v1.2.74/util/spliterator/class.go (about) 1 // Copyright 2020 The searKing Author. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package spliterator 6 7 import ( 8 "context" 9 10 "github.com/searKing/golang/go/error/exception" 11 "github.com/searKing/golang/go/util/class" 12 "github.com/searKing/golang/go/util/function/consumer" 13 "github.com/searKing/golang/go/util/object" 14 ) 15 16 type TODO struct { 17 class.Class 18 } 19 20 func (split *TODO) TryAdvance(action consumer.Consumer) bool { 21 panic(exception.NewIllegalStateException1("called unimplemented TryAdvance method")) 22 } 23 24 func (split *TODO) ForEachRemaining(ctx context.Context, action consumer.Consumer) { 25 class := split.GetDerivedElse(split).(Spliterator) 26 for class.TryAdvance(ctx, action) { 27 } 28 return 29 } 30 31 func (split *TODO) TrySplit() Spliterator { 32 panic(exception.NewIllegalStateException1("called unimplemented TrySplit method")) 33 } 34 35 func (split *TODO) EstimateSize() int { 36 panic(exception.NewIllegalStateException1("called unimplemented EstimateSize method")) 37 } 38 39 func (split *TODO) GetExactSizeIfKnown() int { 40 class := split.GetDerivedElse(split).(Spliterator) 41 if class.Characteristics()&CharacteristicSized == 0 { 42 return -1 43 } 44 return class.EstimateSize() 45 } 46 47 func (split *TODO) Characteristics() Characteristic { 48 panic(exception.NewIllegalStateException1("called unimplemented Characteristics method")) 49 } 50 51 func (split *TODO) HasCharacteristics(characteristics Characteristic) bool { 52 class := split.GetDerivedElse(split).(Spliterator) 53 return (class.Characteristics() & characteristics) == characteristics 54 } 55 56 func (split *TODO) GetComparator() object.Comparator { 57 panic(exception.NewIllegalStateException()) 58 }