-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaVariable.swift
More file actions
46 lines (34 loc) · 1019 Bytes
/
JavaVariable.swift
File metadata and controls
46 lines (34 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// JavaVariable.swift
// textToCode
//
// Created by Michael Smith on 4/21/19.
// Copyright © 2019 Michael Smith. All rights reserved.
//
import Foundation
class JavaVariable{
private var name: String;
private var visability: ItemVisability;
private final var type: String;
init(name: String, vis: String, type: String) {
self.name = name;
self.visability = ItemVisability(rawValue: vis) ?? ItemVisability.defaultItem;
self.type = type.uppercasingFirst;
}
func getName() -> String{
return self.name;
}
func getVis() -> ItemVisability{
return self.visability;
}
func getType() -> String{
return self.type;
}
func toString() -> String{
return "\(visability.rawValue) \(type) \(name);"
}
func copy() -> JavaVariable{
let varCopy = JavaVariable.init(name: self.getName(), vis: self.getVis().rawValue, type: self.getType())
return varCopy;
}
}