本文整理汇总了Java中org.dmg.pmml.PMMLObject类的典型用法代码示例。如果您正苦于以下问题:Java PMMLObject类的具体用法?Java PMMLObject怎么用?Java PMMLObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PMMLObject类属于org.dmg.pmml包,在下文中一共展示了PMMLObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: accept
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public VisitorAction accept(Visitor visitor){
VisitorAction status = VisitorAction.CONTINUE;
if((status == VisitorAction.CONTINUE) && hasArguments()){
List<Argument> arguments = getArguments();
for(Argument argument : arguments){
status = PMMLObject.traverse(visitor, argument.getExpression());
if(status != VisitorAction.CONTINUE){
break;
}
}
} // End if
if(status == VisitorAction.TERMINATE){
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
示例2: visit
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());
for(Field field : fields){
Object value = ReflectionUtil.getFieldValue(field, object);
if(value instanceof ArrayList){
ArrayList<?> list = (ArrayList<?>)value;
List<?> transformedList = transform(list);
if(list != transformedList){
ReflectionUtil.setFieldValue(field, object, transformedList);
}
}
}
return VisitorAction.CONTINUE;
}
示例3: visit
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
Class<? extends V> type = getType();
List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());
for(Field field : fields){
Object value = ReflectionUtil.getFieldValue(field, object);
if(type.isInstance(value)){
V internedValue = intern(type.cast(value));
ReflectionUtil.setFieldValue(field, object, internedValue);
}
}
return VisitorAction.CONTINUE;
}
示例4: popParent
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public PMMLObject popParent(){
PMMLObject parent = super.popParent();
if(parent instanceof MiningModel){
MiningModel miningModel = (MiningModel)parent;
processMiningModel(miningModel);
} else
if(parent instanceof Model){
Model model = (Model)parent;
processModel(model);
}
return parent;
}
示例5: process
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
private void process(Node node){
List<Node> path = new ArrayList<>();
path.add(node);
Deque<PMMLObject> parents = getParents();
for(PMMLObject parent : parents){
if(!(parent instanceof Node)){
break;
}
path.add((Node)parent);
}
Collections.reverse(path);
this.paths.put(node, path);
}
示例6: visit
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());
for(Field field : fields){
Object value = ReflectionUtil.getFieldValue(field, object);
if(value instanceof ArrayList){
ArrayList<?> list = (ArrayList<?>)value;
list.trimToSize();
}
}
return VisitorAction.CONTINUE;
}
示例7: visit
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public VisitorAction visit(PMMLObject object){
List<Field> fields = ReflectionUtil.getInstanceFields(object.getClass());
for(Field field : fields){
if((FieldName.class).equals(field.getType())){
FieldName name = (FieldName)ReflectionUtil.getFieldValue(field, object);
name = filter(name);
ReflectionUtil.setFieldValue(field, object, name);
}
}
return VisitorAction.CONTINUE;
}
示例8: popParent
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public PMMLObject popParent(){
PMMLObject parent = super.popParent();
if(parent instanceof Model){
Model model = (Model)parent;
processModel(model);
} else
if(parent instanceof PMML){
PMML pmml = (PMML)parent;
DataDictionary dataDictionary = pmml.getDataDictionary();
if(dataDictionary != null){
processDataDictionary(dataDictionary);
}
}
return parent;
}
示例9: getParent
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public PMMLObject getParent(Visitor visitor, int index){
Deque<PMMLObject> parents = visitor.getParents();
if(index < 0){
throw new IllegalArgumentException();
} else
if(index == 0){
return parents.getFirst();
}
Iterator<PMMLObject> it = parents.iterator();
for(int i = 0; i < index; i++){
it.next();
}
return it.next();
}
示例10: copyState
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public <E extends PMMLObject> void copyState(E from, E to){
Class<?> fromClazz = from.getClass();
Class<?> toClazz = to.getClass();
// Allow copying to the same class or to a subclass, but not to a superclass
if(!(fromClazz).isAssignableFrom(toClazz)){
throw new IllegalArgumentException();
}
List<Field> fields = getInstanceFields(fromClazz);
for(Field field : fields){
Object value = getFieldValue(field, from);
setFieldValue(field, to, value);
}
}
示例11: getValue
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public <K extends PMMLObject, V> V getValue(K key, LoadingCache<K, V> cache){
try {
return cache.get(key);
} catch(ExecutionException | UncheckedExecutionException e){
Throwable cause = e.getCause();
if(cause instanceof PMMLException){
throw (PMMLException)cause;
}
throw new InvalidElementException(key)
.initCause(cause);
}
}
示例12: isIn
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
/**
* <p>
* Checks if this value is contained in the set of reference values.
* </p>
*/
public boolean isIn(HasValueSet<?> hasValueSet){
if(hasValueSet instanceof HasParsedValueSet){
HasParsedValueSet<?> hasParsedValueSet = (HasParsedValueSet<?>)hasValueSet;
return isIn(hasParsedValueSet);
}
Array array = hasValueSet.getArray();
if(array == null){
throw new MissingElementException(MissingElementException.formatMessage(XPathUtil.formatElement((Class)hasValueSet.getClass()) + "/" + XPathUtil.formatElement(Array.class)), (PMMLObject)hasValueSet);
}
List<String> content = ArrayUtil.getContent(array);
return indexInStrings(content) > -1;
}
示例13: buildMap
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
static
public <K, E extends PMMLObject & Indexable<K>> Map<K, E> buildMap(List<E> elements, boolean nullable){
Map<K, E> result = new LinkedHashMap<>();
for(E element : elements){
K key = ensureKey(element, nullable);
if(result.containsKey(key)){
throw new InvalidElementException(element);
}
result.put(key, element);
}
// Cannot use Guava's ImmutableMap, because it is null-hostile
return Collections.unmodifiableMap(result);
}
示例14: pushParent
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public void pushParent(PMMLObject object){
super.pushParent(object);
if(object instanceof Node){
handleNodePush((Node)object);
}
}
示例15: popParent
import org.dmg.pmml.PMMLObject; //导入依赖的package包/类
@Override
public PMMLObject popParent(){
PMMLObject object = super.popParent();
if(object instanceof Node){
handleNodePop((Node)object);
}
return object;
}