Stop installing librairies during tests
[parser.git] / verigraph / service / src / mcnet / components / NetworkObject.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Politecnico di Torino and others.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Apache License, Version 2.0
6  * which accompanies this distribution, and is available at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *******************************************************************************/
9
10 package mcnet.components;
11
12 import com.microsoft.z3.Context;
13 import com.microsoft.z3.DatatypeExpr;
14
15 /** Represents a generic network object.
16  *
17  */
18 public abstract class NetworkObject extends Core{
19
20         public NetworkObject(Context ctx,Object[]... args) {
21                 super(ctx,args);
22         }
23
24         protected DatatypeExpr z3Node;
25         protected boolean isEndHost;
26         /**
27          * Get a reference to the z3 node this class wraps around
28          * @return
29          */
30         abstract public DatatypeExpr getZ3Node();
31
32         public String toString(){
33                 return z3Node.toString();
34         }
35
36         //There is probably an error: z3Node.hashCode = 0 because AST.hashCode() has always hash=0
37         /*public int hashCode(){
38                 return z3Node.hashCode();
39         }*/
40
41         /**
42          * A simple way to determine the set of endhosts
43          * @return
44          */
45         public boolean isEndHost(){
46             return isEndHost;
47         }
48
49         /**
50          * Wrap methods to set policy
51          * @param policy
52          * @throws UnsupportedOperationException
53          */
54         void setPolicy (Object policy) throws UnsupportedOperationException{
55              throw new UnsupportedOperationException();
56         }
57 }