return id
end
- fun collections_list: Array[String] is cached do return ["List", "ArrayList", "LinkedList", "Vector", "Set", "SortedSet", "HashSet", "TreeSet", "LinkedHashSet", "Map", "SortedMap", "HashMap", "TreeMap", "Hashtable", "LinkedHashMap"]
- fun iterable: Array[String] is cached do return ["ArrayList", "Set", "HashSet", "LinkedHashSet", "LinkedList", "Stack", "TreeSet", "Vector"]
- fun maps: Array[String] is cached do return ["Map", "SortedMap", "HashMap", "TreeMap", "Hashtable", "LinkedHashMap"]
+ var collections_list: Array[String] is lazy do return ["List", "ArrayList", "LinkedList", "Vector", "Set", "SortedSet", "HashSet", "TreeSet", "LinkedHashSet", "Map", "SortedMap", "HashMap", "TreeMap", "Hashtable", "LinkedHashMap"]
+ var iterable: Array[String] is lazy do return ["ArrayList", "Set", "HashSet", "LinkedHashSet", "LinkedList", "Stack", "TreeSet", "Vector"]
+ var maps: Array[String] is lazy do return ["Map", "SortedMap", "HashMap", "TreeMap", "Hashtable", "LinkedHashMap"]
end
class NitType
# Result is returned as an array containg ordered entries:
# `breadcrumbs.first` is the root entry and
# `breadcrumbs.last == self`
- fun breadcrumbs: Array[WikiEntry] is cached do
+ var breadcrumbs: Array[WikiEntry] is lazy do
var path = new Array[WikiEntry]
var entry: nullable WikiEntry = self
while entry != null and not entry.is_root do
# Extract the markdown text from `source_file`.
#
# REQUIRE: `has_source`.
- fun md: String is cached do
+ var md: String is lazy do
assert has_source
var file = new FileReader.open(src_full_path.to_s)
var md = file.read_all
#
# * key: `wiki.name`
# * default: `MyWiki`
- fun wiki_name: String is cached do return value_or_default("wiki.name", "MyWiki")
+ var wiki_name: String is lazy do return value_or_default("wiki.name", "MyWiki")
# Site description.
#
#
# * key: `wiki.desc`
# * default: ``
- fun wiki_desc: String is cached do return value_or_default("wiki.desc", "")
+ var wiki_desc: String is lazy do return value_or_default("wiki.desc", "")
# Site logo url.
#
#
# * key: `wiki.logo`
# * default: ``
- fun wiki_logo: String is cached do return value_or_default("wiki.logo", "")
+ var wiki_logo: String is lazy do return value_or_default("wiki.logo", "")
# Root url of the wiki.
#
# * key: `wiki.root_url`
# * default: `http://localhost/`
- fun root_url: String is cached do return value_or_default("wiki.root_url", "http://localhost/")
+ var root_url: String is lazy do return value_or_default("wiki.root_url", "http://localhost/")
# Root directory of the wiki.
#
# * key: `wiki.root_dir`
# * default: `./`
- fun root_dir: String is cached do return value_or_default("wiki.root_dir", "./").simplify_path
+ var root_dir: String is lazy do return value_or_default("wiki.root_dir", "./").simplify_path
# Pages directory.
#
#
# * key: `wiki.source_dir
# * default: `pages/`
- fun source_dir: String is cached do
+ var source_dir: String is lazy do
return value_or_default("wiki.source_dir", "pages/").simplify_path
end
#
# * key: `wiki.out_dir`
# * default: `out/`
- fun out_dir: String is cached do return value_or_default("wiki.out_dir", "out/").simplify_path
+ var out_dir: String is lazy do return value_or_default("wiki.out_dir", "out/").simplify_path
# Asset files directory.
#
#
# * key: `wiki.assets_dir`
# * default: `assets/`
- fun assets_dir: String is cached do
+ var assets_dir: String is lazy do
return value_or_default("wiki.assets_dir", "assets/").simplify_path
end
#
# * key: `wiki.templates_dir`
# * default: `templates/`
- fun templates_dir: String is cached do
+ var templates_dir: String is lazy do
return value_or_default("wiki.templates_dir", "templates/").simplify_path
end
#
# * key: `wiki.template`
# * default: `template.html`
- fun template_file: String is cached do
+ var template_file: String is lazy do
return value_or_default("wiki.template", "template.html")
end
#
# * key: `wiki.header`
# * default: `header.html`
- fun header_file: String is cached do
+ var header_file: String is lazy do
return value_or_default("wiki.header", "header.html")
end
#
# * key: `wiki.menu`
# * default: `menu.html`
- fun menu_file: String is cached do
+ var menu_file: String is lazy do
return value_or_default("wiki.menu", "menu.html")
end
#
# * key: `wiki.footer`
# * default: `footer.html`
- fun footer_file: String is cached do
+ var footer_file: String is lazy do
return value_or_default("wiki.footer", "footer.html")
end
#
# * key: `wiki.rsync_dir`
# * default: ``
- fun rsync_dir: String is cached do return value_or_default("wiki.rsync_dir", "")
+ var rsync_dir: String is lazy do return value_or_default("wiki.rsync_dir", "")
# Remote repository used to pull modifications on sources.
#
# * key: `wiki.git_origin`
# * default: `origin`
- fun git_origin: String is cached do return value_or_default("wiki.git_origin", "origin")
+ var git_origin: String is lazy do return value_or_default("wiki.git_origin", "origin")
# Remote branch used to pull modifications on sources.
#
# * key: `wiki.git_branch`
# * default: `master`
- fun git_branch: String is cached do return value_or_default("wiki.git_branch", "master")
+ var git_branch: String is lazy do return value_or_default("wiki.git_branch", "master")
end
# WikiSection custom configuration.
#
# If no file `index.md` exists for this section,
# a summary is generated using contained articles.
- fun index: WikiArticle is cached do
+ var index: WikiArticle is lazy do
for child in children.values do
if child isa WikiArticle and child.is_index then return child
end
redef class App
# Resource Manager used to manage resources placed in the `res` folder of the app
- fun resource_manager: ResourcesManager is cached do return new ResourcesManager(self.resources, self.package_name.to_s)
+ var resource_manager: ResourcesManager is lazy do return new ResourcesManager(self.resources, self.package_name.to_s)
# Assets Manager used to manage resources placed in the `assets` folder of the app
- fun asset_manager: AssetManager is cached do return new AssetManager(self)
+ var asset_manager: AssetManager is lazy do return new AssetManager(self)
# Get the native AssetsManager of the application, used to initialize the nit's AssetManager
private fun assets: NativeAssetManager import native_activity in "Java" `{ return App_native_activity(recv).getAssets(); `}
# Returns the default MediaPlayer of the application.
# When you load a music, it goes in this MediaPlayer.
# Use it for advanced sound management
- fun default_mediaplayer: MediaPlayer is cached do return new MediaPlayer
+ var default_mediaplayer: MediaPlayer is lazy do return new MediaPlayer
# Returns the default MediaPlayer of the application.
# When you load a short sound (not a music), it's added to this soundpool.
# Use it for advanced sound management.
- fun default_soundpool: SoundPool is cached do return new SoundPool
+ var default_soundpool: SoundPool is lazy do return new SoundPool
# Get the native audio manager
fun audio_manager: NativeAudioManager import native_activity in "Java" `{
end
redef class App
- fun shared_preferences: SharedPreferences is cached do
+ var shared_preferences: SharedPreferences is lazy do
return new SharedPreferences.privately(self, "")
end
end
redef class App
# Get the handle to this device vibrator as a global ref
- fun vibrator: Vibrator is cached do
+ var vibrator: Vibrator is lazy do
var v = vibrator_native(native_activity)
return v.new_global_ref
end
# Name of the column
#
# require: `self.statement.is_open`
- fun name: String is cached do
+ var name: String is lazy do
assert statement_closed: statement.is_open
return statement.native_statement.column_name(index)
super Rope
super String
- redef fun chars is cached do return new RopeChars(self)
+ redef var chars is lazy do return new RopeChars(self)
end
# Node that represents a concatenation between two `String`
redef fun empty do return ""
- redef fun to_cstring is cached do
+ redef var to_cstring is lazy do
var len = length
var ns = new NativeString(len + 1)
ns[len] = '\0'
super Rope
super Buffer
- redef fun chars: Sequence[Char] is cached do return new RopeBufferChars(self)
+ redef var chars: Sequence[Char] is lazy do return new RopeBufferChars(self)
# The final string being built on the fly
private var str: String is noinit
end
redef class MProject
- redef fun concern_rank is cached do
+ redef var concern_rank is lazy do
var max = 0
for mgroup in mgroups do
var mmax = mgroup.concern_rank
return res
end
- redef fun concern_rank is cached do
+ redef var concern_rank is lazy do
var max = 0
for mmodule in collect_mmodules do
var mmax = mmodule.concern_rank
return mclasses
end
- redef fun concern_rank is cached do
+ redef var concern_rank is lazy do
var max = 0
for p in in_importation.direct_greaters do
var pmax = p.concern_rank
redef class MModule
# Get the type of the class `Serializable`
- fun serializable_type: MClassType is cached do
+ var serializable_type: MClassType is lazy do
return self.get_primitive_class("Serializable").mclass_type
end
end