// Path: leotask/src/core/org/leores/net/Link.java
// public static class Flag implements Serializable {
// 	private static final long serialVersionUID = 1600634581856522821L;
// 	public static final int IN = 1; // Binary 00001
// 	public static final int OUT = 2; // Binary 00010
// 	public static final int UNDIRECTED = 4; // Binary 00100
// }
// 
// Path: leotask/src/core/org/leores/util/able/NewInstanceable.java
// public interface NewInstanceable<E> {
// 	public E newInstance();
// }
// 
// Path: leotask/src/core/org/leores/util/able/Processable1.java
// public interface Processable1<R, A> {
// 	public R process(A a);
// 
// 	public static class MaxListOutSize<A> implements Processable1<String, A> {
// 		protected Integer mSize;// null means do no limit list out size
// 
// 		public MaxListOutSize(Integer mSize) {
// 			this.mSize = mSize;
// 		}
// 
// 		public String process(A a) {
// 			String rtn = null;
// 			if (a != null && U.bAssignable(List.class, a.getClass())) {
// 				List lObj = (List) a;
// 				if (mSize != null && mSize >= 0 && mSize < lObj.size()) {
// 					List lOut = lObj.subList(0, mSize);
// 					rtn = lOut + "...";
// 				} else {
// 					rtn = lObj + "";
// 				}
// 			}
// 			return rtn;
// 		}
// 	}
// 
// 	public static class ArrayToString<A> implements Processable1<String, A> {
// 		public String process(A a) {
// 			String rtn = a + "";
// 			if (a != null && a instanceof Object[]) {
// 				rtn = "[";
// 				Object[] aa = (Object[]) a;
// 				for (int i = 0; i < aa.length; i++) {
// 					rtn += aa[i];
// 					if (i + 1 < aa.length) {
// 						rtn += ",";
// 					}
// 				}
// 				rtn += "]";
// 			}
// 			return rtn;
// 		}
// 	}
// 
// 	public static class Expression<A> implements Processable1<A, A> {
// 		public String sElement, sExpression;
// 
// 		public Expression(String sElement, String sExpression) {
// 			this.sElement = sElement;
// 			this.sExpression = sExpression;
// 		}
// 
// 		public Expression(String sExpression) {
// 			this("%", sExpression);
// 		}
// 
// 		public A process(A a) {
// 			A rtn = a;
// 			if (a != null) {
// 				String sExpToEval = sExpression.replace(sElement, a + "");
// 				BigDecimal bdEvalRtn = U.eval1Expression(sExpToEval);
// 				if (bdEvalRtn != null) {
// 					rtn = (A) U.newInstance(a.getClass(), bdEvalRtn + "");
// 				} else {
// 					rtn = null;
// 				}
// 			}
// 			return rtn;
// 		}
// 
// 	}
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.leores.net.Link.Flag;
import org.leores.util.*;
import org.leores.util.able.NewInstanceable;
import org.leores.util.able.Processable1;

		rtn.clear();
		for (int i = 0, size = nodes.size(); i < size; i++) {
			Node node = nodes.get(i);
			if (node != null && (pa1 == null || pa1.process(node))) {
				//degree should not be null here as node in nodes should be in this network!
				Node.Degree degree = node.getDegree(this);
				while (rtn.size() < degree.max() + 1) {
					Node.Degree nd = new Node.Degree();
					rtn.add(nd);
				}
				Node.Degree eNodeDegree;
				eNodeDegree = rtn.get(degree.in);
				eNodeDegree.in++;
				eNodeDegree = rtn.get(degree.out);
				eNodeDegree.out++;
				eNodeDegree = rtn.get(degree.undirected);
				eNodeDegree.undirected++;
			}
		}

		return rtn;
	}

	public List<Integer> getDegreeList(int flags, Processable1<Boolean, Node> pa1) {
		List<Integer> rtn = new ArrayList<Integer>();

		updateDegreeList(pa1);
		for (int i = 0, size = lDegree.size(); i < size; i++) {
			Integer nDegree = 0;
			Node.Degree eDegree = lDegree.get(i);

// Path: leotask/src/core/org/leores/net/Link.java
// public static class Flag implements Serializable {
// 	private static final long serialVersionUID = 1600634581856522821L;
// 	public static final int IN = 1; // Binary 00001
// 	public static final int OUT = 2; // Binary 00010
// 	public static final int UNDIRECTED = 4; // Binary 00100
// }
// 
// Path: leotask/src/core/org/leores/util/able/NewInstanceable.java
// public interface NewInstanceable<E> {
// 	public E newInstance();
// }
// 
// Path: leotask/src/core/org/leores/util/able/Processable1.java
// public interface Processable1<R, A> {
// 	public R process(A a);
// 
// 	public static class MaxListOutSize<A> implements Processable1<String, A> {
// 		protected Integer mSize;// null means do no limit list out size
// 
// 		public MaxListOutSize(Integer mSize) {
// 			this.mSize = mSize;
// 		}
// 
// 		public String process(A a) {
// 			String rtn = null;
// 			if (a != null && U.bAssignable(List.class, a.getClass())) {
// 				List lObj = (List) a;
// 				if (mSize != null && mSize >= 0 && mSize < lObj.size()) {
// 					List lOut = lObj.subList(0, mSize);
// 					rtn = lOut + "...";
// 				} else {
// 					rtn = lObj + "";
// 				}
// 			}
// 			return rtn;
// 		}
// 	}
// 
// 	public static class ArrayToString<A> implements Processable1<String, A> {
// 		public String process(A a) {
// 			String rtn = a + "";
// 			if (a != null && a instanceof Object[]) {
// 				rtn = "[";
// 				Object[] aa = (Object[]) a;
// 				for (int i = 0; i < aa.length; i++) {
// 					rtn += aa[i];
// 					if (i + 1 < aa.length) {
// 						rtn += ",";
// 					}
// 				}
// 				rtn += "]";
// 			}
// 			return rtn;
// 		}
// 	}
// 
// 	public static class Expression<A> implements Processable1<A, A> {
// 		public String sElement, sExpression;
// 
// 		public Expression(String sElement, String sExpression) {
// 			this.sElement = sElement;
// 			this.sExpression = sExpression;
// 		}
// 
// 		public Expression(String sExpression) {
// 			this("%", sExpression);
// 		}
// 
// 		public A process(A a) {
// 			A rtn = a;
// 			if (a != null) {
// 				String sExpToEval = sExpression.replace(sElement, a + "");
// 				BigDecimal bdEvalRtn = U.eval1Expression(sExpToEval);
// 				if (bdEvalRtn != null) {
// 					rtn = (A) U.newInstance(a.getClass(), bdEvalRtn + "");
// 				} else {
// 					rtn = null;
// 				}
// 			}
// 			return rtn;
// 		}
// 
// 	}
// }


// Path: leotask/src/core/org/leores/net/Network.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.leores.net.Link.Flag;
import org.leores.util.*;
import org.leores.util.able.NewInstanceable;
import org.leores.util.able.Processable1;

		rtn.clear();
		for (int i = 0, size = nodes.size(); i < size; i++) {
			Node node = nodes.get(i);
			if (node != null && (pa1 == null || pa1.process(node))) {
				//degree should not be null here as node in nodes should be in this network!
				Node.Degree degree = node.getDegree(this);
				while (rtn.size() < degree.max() + 1) {
					Node.Degree nd = new Node.Degree();
					rtn.add(nd);
				}
				Node.Degree eNodeDegree;
				eNodeDegree = rtn.get(degree.in);
				eNodeDegree.in++;
				eNodeDegree = rtn.get(degree.out);
				eNodeDegree.out++;
				eNodeDegree = rtn.get(degree.undirected);
				eNodeDegree.undirected++;
			}
		}

		return rtn;
	}

	public List<Integer> getDegreeList(int flags, Processable1<Boolean, Node> pa1) {
		List<Integer> rtn = new ArrayList<Integer>();

		updateDegreeList(pa1);
		for (int i = 0, size = lDegree.size(); i < size; i++) {
			Integer nDegree = 0;
			Node.Degree eDegree = lDegree.get(i);

			if ((flags & Link.Flag.IN) > 0) {
