本文整理汇总了Java中org.dmfs.iterables.Split类的典型用法代码示例。如果您正苦于以下问题:Java Split类的具体用法?Java Split怎么用?Java Split使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Split类属于org.dmfs.iterables包,在下文中一共展示了Split类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tokenCount
import org.dmfs.iterables.Split; //导入依赖的package包/类
@Override
public int tokenCount()
{
if (mScope.isEmpty())
{
return 0;
}
int count = 0;
for (CharSequence token : new Split(mScope, ' '))
{
count += 1;
}
return count;
}
示例2: DateTimeList
import org.dmfs.iterables.Split; //导入依赖的package包/类
public DateTimeList(TimeZone timeZone, String dateTimeList)
{
super(new Mapped<>(
datetime -> !datetime.isFloating() && timeZone != null ? datetime.shiftTimeZone(timeZone) : datetime,
new Mapped<CharSequence, DateTime>(
charSequence -> DateTime.parse(timeZone, charSequence.toString()),
new Split(dateTimeList, ','))));
}
示例3: getList
import org.dmfs.iterables.Split; //导入依赖的package包/类
/**
* Gets the lists of TaskLists ordered by recently use.
*
* @param context
* Context
*
* @return List of TaskLists where the most recently used list is on position 0.
*/
private static List<Long> getList(Context context)
{
Optional<String> listStrOpt = new NullSafe<>(PreferenceManager.getDefaultSharedPreferences(context).getString(PREFERENCE_KEY, null));
Log.v(RecentlyUsedLists.class.getSimpleName(), "getList: " + listStrOpt.value("empty"));
if (!listStrOpt.isPresent())
{
return new ArrayList<>(0);
}
String listStr = listStrOpt.value();
// Handling known bug https://github.com/dmfs/opentasks/issues/562
// See also {@link RecentlyUsedListsNullHandlingTest}
if (listStr.contains("null"))
{
setList(context, toList(new Fluent<>(new Split(listStr, ','))
.mapped(Object::toString)
.filtered(s -> !s.isEmpty())
.filtered(s -> !s.equals("null"))
.mapped(Long::valueOf)));
return getList(context);
}
return toList(new Fluent<>(new Split(listStr, ','))
.mapped(Object::toString)
.filtered(s -> !s.isEmpty())
.mapped(Long::valueOf));
}