我如何将LinkedHashSet转换为Java中的EnumSet?(How can I convert a LinkedHashSet to an EnumSet in Java?)
我正在尝试制作一个将
LinkedHashSet
转换为EnumSet
的bean。 这是必需的,因为Neo4j需要这种情况下的转换类。 迄今为止我已经实现了这个类:public class LinkedHashSetToEnumSet implements Converter<LinkedHashSet<Access>, EnumSet<Access>> { @Override public EnumSet<Access> convert(LinkedHashSet<Access> h) { EnumSet<Access> e = new EnumSet<Access>(); // error here // Somehow do a for loop to add all of e to h? return e; } }
我得到一个错误,我有注释行
// error here
这里错误是:
Cannot instantiate the type EnumSet<Resource.Access>
有没有一些简单的东西,我在这里失踪创建一个
EnumSet
?编辑:
是否有可能将
HashSet
转换为EnumSet
?I am trying to make a bean for converting
LinkedHashSet
into anEnumSet
. This is required because Neo4j needs a conversion class for this situation. I have implemented the class so far as:public class LinkedHashSetToEnumSet implements Converter<LinkedHashSet<Access>, EnumSet<Access>> { @Override public EnumSet<Access> convert(LinkedHashSet<Access> h) { EnumSet<Access> e = new EnumSet<Access>(); // error here // Somehow do a for loop to add all of e to h? return e; } }
I get an error where I have the commented line
// error here
where the error is:
Cannot instantiate the type EnumSet<Resource.Access>
Is there some simple thing that I am missing here for creating an
EnumSet
?EDIT:
Is it possible to convert a
HashSet
into anEnumSet
?
原文:https://stackoverflow.com/questions/18880342
最满意答案
您是否在系列定义中定义了categoryField? 就像是
series: [{ field: 'value', categoryField: 'category', type: 'column' }]
我得到一个只有两个类别列的图表( http://jsbin.com/AcetIXAL/1/edit )。 但是,如果我将categoryAxis中的类别定义为
series: [{ field: 'value', type: 'column' }], categoryAxis: { field: 'category' },
我得到了所有三列( http://jsbin.com/AcetIXAL/2/edit )。
Do you have your categoryField defined in the series definition ? Something like
series: [{ field: 'value', categoryField: 'category', type: 'column' }]
I get a chart with only two category columns (http://jsbin.com/AcetIXAL/1/edit). But if I define the category in the categoryAxis as in
series: [{ field: 'value', type: 'column' }], categoryAxis: { field: 'category' },
I get all three columns (http://jsbin.com/AcetIXAL/2/edit).
相关问答
更多-
dataviz:是用于silverlight工具包数据可视化namespce的常用xml名称空间别名。 这是针对Silverlight 3版本的,当时图书馆无法定义他们自己的XML名称空间。 .NET命名空间System.Windows.Controls.DataVisualization将被映射到像这样的前缀dataviz : - xmlns:dataviz="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.W ...
-
在数据源上具有500+值的KendoUI折线图是延迟加载的(KendoUI Line Chart with 500+ values on datasource is lazy loaded)[2022-06-29]
最后我使用FlotCharts,由于某种原因,KendoUI Chart加载数据非常懒惰...我使用Kendo Ui Datasource从Web Service读取数据并加载FloatChart ... http://www.flotcharts.org/ 这是简单,快速和免费的软件 Finally I Use FlotCharts, For some reason the KendoUI Chart laoad data very lazy... I use Kendo Ui Datasource fo ... -
Kendo AutoComplete旨在允许自定义值,并且更像Google搜索输入。 如果您想控制输入值,那么最好使用ComboBox组件并隐藏toggle按钮: styles: [` .k-combobox .k-select { display: none } .k-combobox .k-input { padding-right: 0; } .k-combobox .k-dropdown-wrap .k-i-close { right: 4px; } `], 这是一个可运行的plu ...
-
您是否在系列定义中定义了categoryField? 就像是 series: [{ field: 'value', categoryField: 'category', type: 'column' }] 我得到一个只有两个类别列的图表( http://jsbin.com/AcetIXAL/1/edit )。 但是,如果我将categoryAxis中的类别定义为 series: [{ field: 'value', type: 'column' }], categoryAxis: { field: 'ca ...
-
我的建议是通过图表数据源的API来操纵数据点。 每5秒钟刷新一次不应该是一个问题,特别是如果你关闭过渡 : $("#chart").kendoChart({ transitions: false }); My suggestion is to manipulate the data points via the API of the chart Data Source. One refresh every 5 seconds or so shouldn't be a problem, especi ...
-
在图表div本身上设置宽度。 我在这里限制一个。 它看起来很糟糕,但只是为了表明你可以挤压它.. http://jsfiddle.net/burkeholland/drXnR/ Set the width on the chart div itself. I constrained one here. It looks terrible, but just to show that you can squeeze it down.. http://jsfiddle.net/burkeholland/drXn ...
-
我无法想出一种显示“隐藏”数据点的方法。 我以前必须做类似的事情,并使用自定义工具提示模板功能。 在函数中,我获取类别(散点图示例中的x值),并从数据源中获取所有匹配的项目。 然后只是把某种列表/等组合在一起。 并返回。 您总是可以超级想象并制作一个带有标签的框和整个九码,以显示该特定点上的每个dataItem。 请参阅jsbin上的示例 http://jsbin.com/ONuQUgiY/1/edit I've not been able to figure out a way to show "hidd ...
-
由于多种原因,PageLoad可能会被触发两次(这取决于页面内容/设置),您可以在此处找到更多详细信息(和答案): http : //forums.asp.net/t/990627.aspx/1 PageLoad may be fired twice for many reasons (and it depends on page content/set-up), you can find more details (and an answer) here: http://forums.asp.net/t/ ...
-
看起来异常来自于来自服务器的总变量不再位于名为__count的字段内。 我怀疑在较新版本的协议中以不同的方式调用它。 因此,您可能需要显式指定它(通过schema.total ),其方式与此处所示的几乎相同。 即 schema: { total: function (e) { return Number(e["odata.count"]); }, For anyone having the same issue: schem ...
-
KendoUI ChartEventBuilder DataBinding事件无法正常工作(KendoUI ChartEventBuilder DataBinding event not working)[2022-04-15]
ChartEventBuilder中不应存在DataBinding事件。 在从传统的Telerik MVC Extensions迁移过程中,它可能被错误地转移了。 请改用DataSource RequestStart事件 : @(Html.Kendo().Chart() .Name("chart") .DataSource(ds => ds .Read(read => read.Action("Data", "Chart")) .Events ...