- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要制作一个可扩展的 ListView ,但对于父级我必须传递 arraylist 并且我在 getGroupView 中遇到类转换异常。请帮助我编写以下适配器:
PhraseModel.java:
package in.abc.pdfsearchapp;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
public class PhraseModel implements Parcelable {
private ArrayList<PhraseList> phraseList;
// constructor
public PhraseModel(ArrayList<PhraseList> phraseList) {
this.phraseList = phraseList;
}
//---------------------------Getter-Setter--------------------------------------------------------------------------------
public ArrayList<PhraseList> getPhraseList() {
return phraseList;
}
public void setPhraseList(ArrayList<PhraseList> phraseList) {
this.phraseList = phraseList;
}
// Parcelling
protected PhraseModel(Parcel in) {
phraseList=in.createTypedArrayList(PhraseList.CREATOR);
}
public static final Creator<PhraseModel> CREATOR = new Creator<PhraseModel>() {
@Override
public PhraseModel createFromParcel(Parcel in) {
return new PhraseModel(in);
}
@Override
public PhraseModel[] newArray(int size) {
return new PhraseModel[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeTypedList(phraseList);
}
//----------------------------------- //PhraseList // ------------------------------------------------------------------------
public static class PhraseList implements Parcelable {
public int documentId,noOfOccurences;
public String documentName,phrase;
public ArrayList<OccurenceDetails> occurenceDetails;
//constructor
public PhraseList(int documentId, String documentName,String phrase, int noOfOccurences, ArrayList<OccurenceDetails> occurenceDetails) {
this.documentId = documentId;
this.documentName = documentName;
this.phrase = phrase;
this.noOfOccurences = noOfOccurences;
this.occurenceDetails = occurenceDetails;
}
//------------------------------Getter-Setter--------------------------------------------------------------------------------------
public int getDocumentId() {
return documentId;
}
public void setDocumentId(int documentId) {
this.documentId = documentId;
}
public int getNoOfOccurences() {
return noOfOccurences;
}
public void setNoOfOccurences(int noOfOccurences) {
this.noOfOccurences = noOfOccurences;
}
public String getDocumentName() {
return documentName;
}
public void setDocumentName(String documentName) {
this.documentName = documentName;
}
public String getPhrase() {
return phrase;
}
public void setPhrase(String phrase) {
this.phrase = phrase;
}
public ArrayList<OccurenceDetails> getOccurenceDetails() {
return occurenceDetails;
}
public void setOccurenceDetails(ArrayList<OccurenceDetails> occurenceDetails) {
this.occurenceDetails = occurenceDetails;
}
//Parcelling
protected PhraseList(Parcel in) {
documentId = in.readInt();
noOfOccurences = in.readInt();
documentName = in.readString();
phrase = in.readString();
}
public static final Creator<PhraseList> CREATOR = new Creator<PhraseList>() {
@Override
public PhraseList createFromParcel(Parcel in) {
return new PhraseList(in);
}
@Override
public PhraseList[] newArray(int size) {
return new PhraseList[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(documentId);
dest.writeString(documentName);
dest.writeInt(noOfOccurences);
dest.writeString(phrase);
}
}
//--------------------------------- //OccurrenceDetails // --------------------------------------------------------------------
public static class OccurenceDetails implements Parcelable {
int occurenceId,pageNo;
String fullPhrase;
//constructor
public OccurenceDetails(int occurenceId, int pageNo, String fullPhrase) {
this.occurenceId = occurenceId;
this.pageNo = pageNo;
this.fullPhrase = fullPhrase;
}
//-------------------------------Getter-Setter----------------------------------------------------------------------------------
public int getOccurenceId() {
return occurenceId;
}
public void setOccurenceId(int occurenceId) {
this.occurenceId = occurenceId;
}
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public String getFullPhrase() {
return fullPhrase;
}
public void setFullPhrase(String fullPhrase) {
this.fullPhrase = fullPhrase;
}
//Parcelling
protected OccurenceDetails(Parcel in) {
occurenceId = in.readInt();
pageNo = in.readInt();
fullPhrase = in.readString();
}
public static final Creator<OccurenceDetails> CREATOR = new Creator<OccurenceDetails>() {
@Override
public OccurenceDetails createFromParcel(Parcel in) {
return new OccurenceDetails(in);
}
@Override
public OccurenceDetails[] newArray(int size) {
return new OccurenceDetails[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(occurenceId);
dest.writeInt(pageNo);
dest.writeString(fullPhrase);
}
}
}
ExpandableListAdapter.java:
package in.abc.pdfsearchapp;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created by Android on 22-Nov-17.
*/
public class ExpandableListAdapter extends BaseExpandableListAdapter {
Context context;
public ArrayList<PhraseModel.PhraseList> mPhraseList;
private HashMap<Integer,ArrayList<PhraseModel.OccurenceDetails>> occurenceList;
public ExpandableListAdapter(Context context, ArrayList<PhraseModel.PhraseList> mPhraseList, HashMap<Integer, ArrayList<PhraseModel.OccurenceDetails>> occurenceList) {
this.context = context;
this.mPhraseList = mPhraseList;
this.occurenceList = occurenceList;
}
public Object getChild(int groupPosition, int childPosition){
return this.occurenceList.get(this.mPhraseList.get(groupPosition)).get(childPosition);
}
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
final ArrayList<PhraseModel.OccurenceDetails> childList = (ArrayList<PhraseModel.OccurenceDetails>) getChild(groupPosition, childPosition);
if(convertView==null){
LayoutInflater infalInflater = (LayoutInflater) this.context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_item, null);
}
TextView occurenceId,fullPhrase,pageNo;
occurenceId=(TextView)convertView.findViewById(R.id.occurenceId);
fullPhrase=(TextView)convertView.findViewById(R.id.fullPhrase);
pageNo=(TextView)convertView.findViewById(R.id.pageNo);
occurenceId.setText(childList.get(groupPosition).getOccurenceId());
fullPhrase.setText(childList.get(groupPosition).getFullPhrase());
pageNo.setText(childList.get(groupPosition).getPageNo());
return convertView;
}
public int getChildrenCount(int groupPosition) {
return this.occurenceList.get(this.mPhraseList.get(groupPosition))
.size();
}
public Object getGroup(int groupPosition) {
return this.mPhraseList.get(groupPosition);
}
public int getGroupCount() {
return this.mPhraseList.size();
}
public long getGroupId(int groupPosition) {
return groupPosition;
}
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
ArrayList<PhraseModel.PhraseList> parentList = (ArrayList<PhraseModel.PhraseList>) getGroup(groupPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this.context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_group, null);
}
TextView docName,totalOccurences;
docName=(TextView)convertView.findViewById(R.id.docName);
totalOccurences=(TextView)convertView.findViewById(R.id.totalOccurences);
docName.setText(parentList.get(groupPosition).getDocumentName());
totalOccurences.setText(parentList.get(groupPosition).getNoOfOccurences());
return convertView;
}
public boolean hasStableIds() {
return false;
}
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
}
LandingActivity.java:
package in.abc.pdfsearchapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
public class LandingActivity extends AppCompatActivity {
ExpandableListAdapter listAdapter;
ExpandableListView expListView;
ArrayList<PhraseModel.PhraseList> phraseLists;
HashMap<Integer, ArrayList<PhraseModel.OccurenceDetails>> occurenceList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_landing);
expListView = (ExpandableListView) findViewById(R.id.phraseList);
// preparing list data
phraseLists=new ArrayList<PhraseModel.PhraseList>();
occurenceList=new HashMap<Integer,ArrayList<PhraseModel.OccurenceDetails>>();
phraseLists.addAll(getmphraseset());
for (PhraseModel.PhraseList pl: phraseLists){
ArrayList<PhraseModel.OccurenceDetails>occurenceDetailses=pl.getOccurenceDetails();
occurenceList.put(pl.getDocumentId(),occurenceDetailses);
}
listAdapter = new ExpandableListAdapter(this, phraseLists,occurenceList);
// setting list adapter
expListView.setAdapter(listAdapter);
// Listview Group click listener
expListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
// Toast.makeText(getApplicationContext(),
// "Group Clicked " + listDataHeader.get(groupPosition),
// Toast.LENGTH_SHORT).show();
return false;
}
});
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
@Override
public void onGroupExpand(int groupPosition) {
Toast.makeText(getApplicationContext(),
phraseLists.get(groupPosition) + " Expanded",
Toast.LENGTH_SHORT).show();
}
});
// Listview Group collasped listener
expListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
@Override
public void onGroupCollapse(int groupPosition) {
Toast.makeText(getApplicationContext(),
phraseLists.get(groupPosition) + " Collapsed",
Toast.LENGTH_SHORT).show();
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
Toast.makeText(
getApplicationContext(),
phraseLists.get(groupPosition)
+ " : "
+ occurenceList.get(
phraseLists.get(groupPosition)).get(
childPosition), Toast.LENGTH_SHORT)
.show();
return false;
}
});
}
private ArrayList<PhraseModel.PhraseList> getmphraseset() {
try{
ArrayList<PhraseModel.PhraseList>phrase_Lists = new ArrayList<PhraseModel.PhraseList>();
ArrayList<PhraseModel.OccurenceDetails>occurenceDetailsArrayList=new ArrayList<PhraseModel.OccurenceDetails>();
JSONObject jsonObject = new JSONObject(readJSONFromAsset());
JSONArray phraseArray = jsonObject.getJSONArray("phraseList");
Log.d("getmphraseset", "phrase count: "+phraseArray.length());
for (int i = 0; i < phraseArray.length(); i++)
{
JSONObject job = phraseArray.getJSONObject(i);
int documentId =job.getInt("documentId");
int noOfOccurences=job.getInt("noOfOccurences");
String documentName=job.getString("documentName");
String phrase=job.getString("phrase");
//This i for Occurences array
ArrayList<PhraseModel.OccurenceDetails> occurencesList = new ArrayList<>();
JSONArray occurencesArray = job.getJSONArray("occurenceDetails");
for (int j = 0; j < occurencesArray.length(); j++) {
JSONObject jobIn = occurencesArray.getJSONObject(j);
int occurenceId=jobIn.getInt("occurenceId");
int pageNo=jobIn.getInt("pageNo");
String fullPhrase=jobIn.getString("fullPhrase");
occurencesList.add(new PhraseModel.OccurenceDetails(occurenceId, pageNo, fullPhrase));
}
//here your Phrase[] value store in pdfArrayList
phrase_Lists.add(new PhraseModel.PhraseList(documentId,documentName,phrase,noOfOccurences,occurencesList));
Log.i("phraseList size = ", ""+phraseArray.length());
}
if (phrase_Lists != null)
{
Log.i("phraseList size = ", ""+phraseArray.length());
}
return phrase_Lists;
}catch (JSONException e){
e.printStackTrace();
return null;
}
}
@Override
protected void onResume() {
super.onResume();
}
public String readJSONFromAsset() {
String json = null;
try {
InputStream is = getAssets().open("hipaJson.json");
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
json = new String(buffer, "UTF-8");
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}
}
Logcat:
11-23 15:52:06.428 1519-2794/? E/ActivityManager: applyOptionsLocked: Unknown animationType=0
11-23 15:52:06.428 459-2412/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
11-23 15:52:07.059 29210-29210/? E/HAL: PATH3 /odm/lib64/hw/gralloc.qcom.so
11-23 15:52:07.059 29210-29210/? E/HAL: PATH2 /vendor/lib64/hw/gralloc.qcom.so
11-23 15:52:07.059 29210-29210/? E/HAL: PATH1 /system/lib64/hw/gralloc.qcom.so
11-23 15:52:07.059 29210-29210/? E/HAL: PATH3 /odm/lib64/hw/gralloc.msm8953.so
11-23 15:52:07.059 29210-29210/? E/HAL: PATH2 /vendor/lib64/hw/gralloc.msm8953.so
11-23 15:52:07.059 29210-29210/? E/HAL: PATH1 /system/lib64/hw/gralloc.msm8953.so
11-23 15:52:11.066 459-2412/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
11-23 15:52:11.152 29210-29210/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: in.hkcl.pdfsearchapp, PID: 29210
java.lang.ClassCastException: in.hkcl.pdfsearchapp.PhraseModel$PhraseList cannot be cast to java.util.ArrayList
at in.hkcl.pdfsearchapp.ExpandableListAdapter.getGroupView(ExpandableListAdapter.java:81)
at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
at android.widget.AbsListView.obtainView(AbsListView.java:2367)
at android.widget.ListView.makeAndAddView(ListView.java:1972)
at android.widget.ListView.fillDown(ListView.java:704)
at android.widget.ListView.fillFromTop(ListView.java:765)
at android.widget.ListView.layoutChildren(ListView.java:1744)
at android.widget.AbsListView.onLayout(AbsListView.java:2161)
at android.view.View.layout(View.java:17548)
at android.view.ViewGroup.layout(ViewGroup.java:5614)
请解释并帮助,我做错了什么?该应用程序具有闪屏>landingActivity,其中包含可扩展列表,因为应用程序崩溃,在 getGroupView 方法中给出了类 cat 异常,因此我无法显示该列表。
list_group.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.CardView
android:id="@+id/parent_phraseList_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#BDBDBD"
app:cardElevation="4dp"
android:padding="8dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:padding="5dp">
<TextView
android:id="@+id/docNameLabel"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Doc Name : "
android:textStyle="bold"/>
<TextView
android:id="@+id/docName"
android:layout_toRightOf="@id/docNameLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/totalOccurencesLabel"
android:layout_below="@id/docNameLabel"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="Total Occurences : "
android:textStyle="bold"/>
<TextView
android:id="@+id/totalOccurences"
android:layout_toRightOf="@id/totalOccurencesLabel"
android:layout_below="@id/docNameLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"/>
<ImageButton
android:id="@+id/linkToDirectOpenDoc_btn"
android:layout_below="@id/totalOccurencesLabel"
android:layout_centerHorizontal="true"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/link"
android:elevation="6dp"
android:layout_marginTop="5dp"/>
<ImageButton
android:id="@+id/expandCard_btn"
android:layout_below="@id/totalOccurencesLabel"
android:layout_toRightOf="@id/linkToDirectOpenDoc_btn"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/expand"
android:elevation="6dp"
android:layout_marginTop="5dp"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
list_item.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp"
android:padding="8dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:background="#FFFFFF">
<TextView
android:id="@+id/occurenceId_label"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Occurence : "
android:textStyle="bold"/>
<TextView
android:id="@+id/occurenceId"
android:layout_toRightOf="@id/occurenceId_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/fullPhrase_label"
android:layout_below="@id/occurenceId_label"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Full Phrase : "
android:textStyle="bold"
android:layout_marginTop="5dp"/>
<TextView
android:id="@+id/fullPhrase"
android:layout_below="@id/occurenceId_label"
android:layout_toRightOf="@id/fullPhrase_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"/>
<TextView
android:id="@+id/pageNo_label"
android:layout_below="@id/fullPhrase_label"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Full Phrase : "
android:textStyle="bold"
android:layout_marginTop="5dp"/>
<TextView
android:id="@+id/pageNo"
android:layout_below="@id/fullPhrase_label"
android:layout_toRightOf="@id/pageNo_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
最佳答案
尝试更换
ArrayList<PhraseModel.PhraseList> parentList = (ArrayList<PhraseModel.PhraseList>) getGroup(groupPosition);
由
PhraseList parentList = (PhraseList) getGroup(groupPosition);
关于java - 如何使用 arraylist 制作可扩展列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47453770/
如标题所示,ans_list是一个答案列表,ans_index是一个数字(答案在词汇表中的索引,但与atm无关) 这里生成的 tree.anslist 是什么? (例如,仅针对第一个),忽略迭代。 f
我目前将用户的输入存储在逗号分隔的列表中,如下所示: Userid | Options 1 | 1,2,5 用户在一个数组形式中勾选一组选项,然后用逗号连接起来 1,2,5 然后 MySQ
我目前将用户的输入存储在逗号分隔的列表中,如下所示: Userid | Options 1 | 1,2,5 用户在一个数组形式中勾选一组选项,然后用逗号连接起来 1,2,5 然后 MySQ
我想知道如何完全展平列表和包含它们的东西。除其他外,我想出了一个解决方案,它可以将具有多个元素的东西滑倒并将它们放回原处,或者在滑倒后将具有一个元素的东西拿走。 这与 How do I “flatte
我想知道如何完全展平列表和包含它们的东西。除其他外,我想出了一个解决方案,它可以将具有多个元素的东西滑倒并将它们放回原处,或者在滑倒后将带有一个元素的东西拿走。 这与 How do I “flatte
这个问题已经有答案了: Convert nested list to 2d array (3 个回答) 已关闭 7 年前。 java中有没有快捷方式可以转换 List> 到 String[][] ?
我在排序时遇到问题 List> 。我创建了一个自定义比较器,在其中编写了对数据进行排序的代码。 public class CustomComparator implements Comparator
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Java Generics: Cannot cast List to List? 我只是想知道为什么下面的java代
试图想出一个 LINQy 方法来做到这一点,但我什么也没想到。 我有一个对象列表<>,其中包含一个属性,该属性是逗号分隔的字母代码列表: lst[0].codes = "AA,BB,DD" lst[1
假设我有这些任务: points = [] point = (1, 2) 我怎么会这样做: points += point 它工作得很好,并且给了我点 = [1, 2]。但是,如果我这样做: poin
如何在 scala 中将 List[Task[List[Header]]] 类型转换为 Task[List[Header]]。 我有一个方法返回 Task[List[Header]] 并多次调用 do
如何在 Java 中查找二维列表的元素? 我有一个参数为 List> 的函数我想知道如何找到这个列表的行和列。 最佳答案 如果你喜欢 List> obj 然后你就可以像这样访问 obj.get(cur
分配 List到 List工作正常。 分配 List>到 List>不编译。 代码 public class Main { public static void main(String[] a
我正在用 Java 编写一个方法,该方法必须接收并迭代 Serializable 的 List。 有什么区别: public void myMethod(List list) { } 和 public
我看到很多人想用 mvvm 更新网格/列表/树的一部分,但他们不想刷新整个列表。 对于所有遇到此问题的人,我做了以下示例。 希望这对你有用。 最佳答案 这是一个简单的例子。整个代码中最重要的是: Bi
我正在为现有的 C++ 库编写包装器,该库使用列表,其中 T 是自定义结构。我被建议使用 vector 而不是列表,但我试图避免修改库。 为了更好地理解这个场景,我做了一个简单的应用程序,使用一个列表
List list List list 这两种声明有什么区别吗? 谢谢, 最佳答案 是的。 List可以包含所有派生自 Base 的不同事物的混合物. List包含同质项(从某种意义上说,它们必须全部
有人可以尽可能详细地解释以下类型之间的区别吗? List List List 让我更具体一点。我什么时候想使用 // 1 public void CanYouGiveMeAnAnswer(List l
我有一个元组列表,每个元组都是一对列表。所以我的数据看起来像: mylist = [(['foo', 'bar'], ['bar', 'bar']),(['bar', 'bar'],['bar', '
也许是一个时髦的标题,但我遇到了以下问题: 给定一个类型为 (a * b) list 的列表,我想创建一个类型为 (a * b list) list 的新列表。一个例子: 给定列表 let testL
我是一名优秀的程序员,十分优秀!